troubleshooting Question

Need assistance in using psexec in vbscript

Avatar of bryanpilger
bryanpilgerFlag for United States of America asked on
ProgrammingVisual Basic ClassicVB Script
7 Comments1 Solution3977 ViewsLast Modified:
I am trying to use psexec in my vbscript to run certain programs as an administrator.
Lets take cmd prompt for example. I use the psexec command to open the cmd prompt on the local machine as using admin credentials. The problem is that it opens up, but then closes right away. Here is the code I am using

objShell.Exec ("psexec.exe \\" & strComputerName & "-u " & strUsername1 & "-p " & strPassword & "cmd.exe")

Is there an argument I can use or something to do this?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
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 1 Answer and 7 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