Link to home
Start Free TrialLog in
Avatar of Akostech
AkostechFlag for United States of America

asked on

Batch File Proccessing

I have a master batch file that calls a sub batch file to to check OS version.  EX:
@Echo off
Echo Checking for Updates
Set SourceDrive=f:\backup
net use u: /delete
del \\JAXBACK02\f$\backup_logs\%ComputerName%.txt
del \\JAXBACK02\f$\backup_logs\%ComputerName%_rsync.log
net use u: \\jaxback02\u$\%computername%
Call \\jaxback02\f$\backup\os.bat

The sub batch file reads:


ver | find "Version 5.2" > nul
if %ERRORLEVEL% == 1 goto Win2k

:Win2k
Call "\\jaxback02\f$\backup\rsyncDc.bat"
goto theexit

Once the OS versions is determined to be Win2k then a nother script runs This all works well except after the sub batch file runs, the maaster batch file continues to process. I want all processing to stop once the sub is called.  
Avatar of infoseccons
infoseccons
Flag of Netherlands image

You could just use the EXIT command?
For instance check the errorlevel the os.bat sub batch returns and exit or not based on that?

"if %ERRORLEVEL% == nn EXIT"


ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Akostech

ASKER

that worked like a charm