Runas Assistance

Author Message
Moddedout

  • Total Posts : 20
  • Scores: 0
  • Reward points : 0
  • Joined: 1/6/2010
  • Status: offline
Runas Assistance Tuesday, February 07, 2012 8:52 AM (permalink)
0
Hey guys and gals,
 
I have the following code that works if I launch it from a cmd prompt window under admin rights. I want to throw in a few more pieces of code that will allow me to launch them as runas too. First steps first though. I want to add code to prompt me for username and then open a cmd box that prompts for password securely of course. I have seen this done in the following post http://www.visualbasicscr...mp;high=explorer+runas which works well except for the fact that a few items don't work and I am still new to scripting and want to understand how to do it on my own. Any help would be appreciated and please understand I don't want someone to do it for me I want to learn how to do it myself please.
SeparateProcessReg = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\SeparateProcess"

set WshShell = WScript.CreateObject("WScript.Shell")
SeparateProcess = WshShell.RegRead(SeparateProcessReg)

If SeparateProcess = 1 Then

WshShell.Run "%SystemRoot%\explorer.exe /seperate"

Else

WshShell.RegWrite SeparateProcessReg, 1, "REG_DWORD"
WshShell.Run "%SystemRoot%\explorer /seperate"
WScript.Sleep(1000)
WshShell.RegWrite SeparateProcessReg, SeparateProcess, "REG_DWORD"

End If

 
#1
    59cobalt

    • Total Posts : 979
    • Scores: 91
    • Reward points : 0
    • Joined: 7/17/2011
    • Status: offline
    Re:Runas Assistance Tuesday, February 07, 2012 10:23 AM (permalink)
    0
    One thing that might cause items to not work is using /sepErate instead of /sepArate.
     
    #2
      Moddedout

      • Total Posts : 20
      • Scores: 0
      • Reward points : 0
      • Joined: 1/6/2010
      • Status: offline
      Re:Runas Assistance Wednesday, February 08, 2012 12:50 AM (permalink)
      0
      Typo on my part. I checked the script and it does work but I would still like to add a runas component that either calls the script or is included. Once that is done I would like to learn how to add more components to it such as computer management or some other MSC. This would help me to learn more about scripting as I would have a use for it.
       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9