Run a program as a specific user...

Download Template
Launch files as a specific user. Sample: set WshShell = WScript.CreateObject("WScript.Shell") "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.

February 16, 2012

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

        set wshshell = Nothing

You must be logged in to comment.