Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question on WshShell.Runas

Status
Not open for further replies.

Briandr

MIS
Jul 11, 2003
177
US
Hi,

I want to run an existing vbscript using different user name and password.

WshShell.Runas "cmd.exe /c Net Localgroup " & Chr(34 ) & "Administrators" & Chr(34 ) & "abc\Test /add

If I got this right I am specifying the local group (admins) and the domain group (abc\test), but how do I adjust the coding to specify the user name and password I want this run under?

Thanks.
 
You might want to consider using PowerShell for this. You can save credentials in an encrypted format and import them for later use.

I hope that helps.

Regards,

Mark

No trees were harmed in posting this message, however a significant number of electrons were terribly inconvenienced.

Check out my scripting solutions at
Work SMARTER not HARDER.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top