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

Failure of batch script..

Status
Not open for further replies.

shantanu125

Programmer
May 8, 2002
30
US
Hi Buddies,

we have a dos script which is used for taking nt backup.
A single batch file calls many other batch files by using call command. One such batch script is for taking backup on tape. Because of hardware problem sometimes the backup doesn't happens and the batch file stops executing. We want to bypass this error. Can we return the success or failure of a batch script. If it is so then we can easily trap the error and continue with executing the other batch files.
Any Suggestion........

Shantanu
 
After a call command starts and/or runs, create a text file (see below). When the next called batch starts, check to see if the text file exists. If not you have an error. If it does exist, erase the file and do the next set of commands.

*****************************************
AT blah blah blah
call batch2.bat
call batch3.bat

===================
BATCH2.BAT

do batch2 commands
copy c:\windows\autoexec.nt c:\windows\batch2ok.txt
===========================================
BATCH3.BAT

if not exist c:\windwows\batch2ok.txt goto onerror
erase c:\windows\batch2ok.txt
do batch 3 commands
create batch3ok.txt


GlennA
MIS






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top