Run a program as a specific user...

Download Template
Launch files as a specific user. Sample: set WshShell = WScript.CreateObject("WScript.Shell") WshShell.run "runas /user:Administrator ""C:\Program Files\Internet Explorer\iexplore.exe""" 'Open command prompt WScript.Sleep(1000) WshShell.SendKeys("AdminPassword") 'send password WshShell.SendKeys("{ENTER}") 'send enter keystroke WScript.Sleep(1000) set wshshell = Nothing Launches IE as a Administrator.

m3crast
February 16, 2012





        set WshShell = WScript.CreateObject("WScript.Shell")

        WshShell.run "runas /user:%{NTLM_Domain}%\%{NTLM_User_Name}% ""%{Program_to_Run_File_Path}%""" 'Open command prompt as a certain user 
        WScript.Sleep(%{Sleep_Length_MilliSeconds}%)
        WshShell.SendKeys("%{Password}%") 'send password   
        WshShell.SendKeys("{ENTER}") 'send enter keystroke
        WScript.Sleep(%{Sleep_Length_MilliSeconds}%)


        set wshshell = Nothing

You must be logged in to comment.