‘RUN AS’ Multiple Programs

How to ‘RUN AS’ Multiple Programs using a script in Windows

Create “RunApp.vbs” and copy /past below, (modify file name/path and account)

 

Option explicit

Dim oShell

set oShell= Wscript.CreateObject(“WScript.Shell”)

oShell.Run “RunAs /noprofile /user:ITmug\ahmet “”C:\Deneme\calc.exe”””

WScript.Sleep 100

oShell.Sendkeys “mypassword”

oShell.SendKeys “{ENTER}”

WScript.Sleep 1000

oShell.Run “RunAs /noprofile /user: ITmug\ahmet “”C:\Deneme\Test.bat”””

WScript.Sleep 100

oShell.Sendkeys “mypassword”

oShell.SendKeys “{ENTER}”

WScript.Sleep 1000

Wscript.Quit

 

Note:

 ITmug\ahmet – >  DomainName\Account for “Run As”

C:\Deneme\Test.bat – > Path and file name

mypassword – > Password.

100 – Some waiting time to initialize ‘run as’

1000 – Waiting time until next program run. (Configure this as you want)

Leave a comment