RunAs Prompt for credentials
I'm trying to write a batch script that will do a RunAs for any given
windows service (using explorer.exe to test) for any given user that can
be input at time of running. What I currently have is this.
set /p Var1="Domain = "
set /p Var2="Username = "
set /p Var3="Service to open= "
RunAs /user:%Var1%\%Var2% "%Var3%" /seperate
On command line, this seems to work ok (with coded values instead of
variables) but in a batch file it just seems to repeat itself, without
opening what it's been specified (it doesn't even prompt for a password,
so I can only presume its not even trying). Any idea why it's looping and
what I can do to stop it?
Cheers
No comments:
Post a Comment