Sign in to follow this  
Followers 0
volkanos

How to use variable with RunWait and COMSPEC ??

2 posts in this topic

How to use variable with RunWait and COMSPEC ??

Example (I know psexec request a password if I don't use -p passwd (It's for the example)):

$iPasswd = InputBox("Admin password", "", "", "*")

RunWait(@COMSPEC & ' /c psexec @NetworkScan.txt -u Administrateur -p $iPasswd -i -d -e cmd "/C net user etudiant $iPasswd"')

How to say that $iPasswd is a variable??

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

RunWait(@COMSPEC & ' /c psexec @NetworkScan.txt -u Administrateur -p ' & $iPasswd & ' -i -d -e cmd "/C net user etudiant' & $iPasswd & '"')

Close quotes and use & between variables/txt

Edited by ZacUSNYR

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0