‘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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s