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

Calling a batchfile to run in VBscript code 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello, I need help on calling a batch file in the VBScript code. For example I have a test.bat file and fail.vbs file. While the fail.vbs runs I want the test.bat file to run in somewhere in the middle. Basically I want to know the syntax that will call the test.bat file to be executed in Vb script.
 
If you have WScript installed on your system, here is one way:

Dim Command, WshShell

Set WshShell = CreateObject("WScript.Shell")

Command = "C:\myfolder\mybathfile.bat"

WshShell.Run Command, 1, -1

Set WshShell = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top