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!

Run batch file in Vbs script

Status
Not open for further replies.

kwaddy

IS-IT--Management
Dec 15, 2002
15
US
I need help in creating a module to run a batch file from a .vbs script. Any help would be greatly appreciated.
 
Kwaddy,
This script runs test.bat and then does a backup using pkzip.
on the ss.run line the ,1,true at the end makes the script
wait until test.bat is over before running the backup
Enjoy Bob

Set ss = CreateObject("WScript.Shell")
ss.run "C:\folder\folder\test.bat",1,true
set ss = nothing

returncode=msgbox ("mount a 3.5 diskette for backup",65,"backup start")
if returncode=1 then
Set ss = CreateObject("WScript.Shell")
ss.run "COMMAND /C C:\util\pkzip.exe a:master77.zip y:\rds\rds77\master.txt ",1,TRUE
set ss = nothing
msgbox "backup is done please remove the diskette",64,"backup finished"
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top