troubleshooting Question

VB Script for login

Avatar of SimonJohnG
SimonJohnG asked on
Windows NetworkingVB ScriptNetwork Operations
2 Comments2 Solutions1069 ViewsLast Modified:
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
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros