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

Running a .bat file

Status
Not open for further replies.

Cretin

Technical User
Jan 2, 2003
194
US
We have an automated job scheduler we would like to use to run .bat files. The problem is the scheduler cannot open .bat files, however it can execute VB script. However I have no clue how to run a .bat file in VB script. Any help to get me going would be appreciated.

Cretin
 
Search for examples of the .Run method of the WshShell object. Or, just read the WSH documentation.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
This is what I did if anyone has any better solutions I would love to hear them:

dim shell
set shell=createobject("wscript.shell")
shell.run "test.bat"
set shell=nothing

Cretin
 
Nope... that would be the way to do it. You can use other methods, but that one is the easiest to use.

PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top