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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute .bat file in .vbs 1

Status
Not open for further replies.

smalley

Programmer
Feb 8, 2001
17
0
0
US
I need to know how to execute a .bat file in a .vbs. The way that it was written was with the following command:
proc0.execute "startup.bat"

The problem is that this doesn't do anything. The execute command is skipped.

Please help!!!

Thank you.
 
Use the Run method of the Shell object.

Set objShell = CreateObject("WScript.Shell")
objShell.Run "C:\startup.bat"

There is an Execute method of the RegExp object, but that's for doing expression searches. There is also an Execute statement, but that's for executing commands stored in string variables. Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top