Link to home
Create AccountLog in
Avatar of llarava
llaravaFlag for Afghanistan

asked on

VBS script that executes a dos command

Hi,

I need help getting a quick vbs that will execute the following command

change user /install

Any help?
Avatar of kaufmed
kaufmed
Flag of United States of America image

Perhaps?

Set sh = WScript.CreateObject("WSCript.shell")

sh.Run "change user /install"

Open in new window

SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Bill Prew
Bill Prew

Seems to run okay without invoking CMD for me here...

~bp
OK cool. Ignore me then ;-)
Yes, change is not a built-in command (which you can verify by executing where change). Something like echo would have to be executed with RobSampson's approach.