Link to home
Start Free TrialLog in
Avatar of SimonJohnG
SimonJohnG

asked on

VB Script for login

I have created a login script for VPN users, see below (A) This script needs to run in elevated mode but I dont know how to do this with the 'run' command so I created a script (B) to call (A) using 'Execute' command and used the 'RUNAS' option. If I run (A) independantly all the exe's run, if I run (B) only the first exe runs in (A). Why? My preference is to have this in one file but my VB experience is zero and bothched this together, please help. Just need all to run in one file. rgd Simon

(A - scriptrun.vbs)
Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.run("ipconfig.exe /registerdns"),0
objShell.run("eventsentry_upd.exe /server:l-gilkess-pc /group:Laptops /installupdate"),0
objShell.run("iadvisoragnt.exe"),0
Set objShell = Nothing

(B )
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "cscript", "o:\softhardaudit\scriptrun.vbs", "", "runas", 0
ASKER CERTIFIED SOLUTION
Avatar of ltlbearand3
ltlbearand3
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial