Project and Portfolio Management Practitioners Forum
cancel

trouble using runas command to kick off vbs script

Highlighted
bzdafro
Honored Contributor.

trouble using runas command to kick off vbs script

Hi,

I am trying to use the windows runas command to execute a vbs script as a domain user. I cant get the command to work. I think it has to do with the " " that are needed around the cscript command. It must be "'s. single ' quote does not work. Has anyone successfully used this command? This is the command I tried:


ksc_simple_respond "runas /user:nt_a\\testuser\ 'cscript.exe d:\BTG_Scripts\BTG_Group_User_Check.vbs'" "Enter the password for nt_a\testuser:" "[USR="testuser".PASSWORD]"

and

ksc_simple_respond 'runas /user:nt_a\\testuser\ "cscript.exe d:\BTG_Scripts\BTG_Group_User_Check.vbs"' "Enter the password for nt_a\testuser:" "[USR="testuser".PASSWORD]"

nether seem to work. It just hangs after prompting for the password in the execution log.
3 REPLIES
bzdafro
Honored Contributor.

Re: trouble using runas command to kick off vbs script

bump
bzdafro
Honored Contributor.

Re: trouble using runas command to kick off vbs script

Anyone running windows runas command from PPM? Or executing a script from PPM to add / remove a user from active directory?
Cesar Roque
Respected Contributor.

Re: trouble using runas command to kick off vbs script

Maybe you can try using a batch file, you can run the runas command from that file, and using the ksc_local_exec command to run that .bat file you can pass the password parameter to it.