|
Answer» i have 2 batch files -- B.bat containing - @ECHO OFF
ECHO TESTING 1 ECHO TESTING 2 ECHO TESTING 3 ECHO TESTING 4 ECHO TESTING 5
ECHO Pausing for review
and A.bat containing
@ECHO OFF SETLOCAL
IF EXIST BUILD_DETAILS.TXT ( ECHO DELETING BUILD_DETAILS.TXT DEL BUILD_DETAILS.TXT ) ELSE ( ECHO FILE MISSING )
ECHO STOPPING FIREWALL SERVICE NET STOP "SharedAccess" SET BuildStartTime=%time% ECHO Build Start Time %BuildStartTime% ECHO . ECHO RUNNING B.bat........ B.bat > BUILD_DETAILS.TXT ECHO . ECHO B.bat HAS BEEN EXECUTED... SET BuildEndTime=%time% ECHO Build End Time %BuildEndTime% PAUSE EXIT
==================================================================== A.bat call B.bat - BUILD_DETAILS.TXT gets created but the control doesnt return back to A.bat after that. I ended B.bat with PAUSE or EXIT. with PAUSE, i could see the ECHO statements of A.bat at the DOS prompt but "RUNNING B.bat........" is the last text i see. Where am i going wrong ?
Thanks for viewing my POST and helping me.check out CALL it will execute the batch file and return control to the main batch -- remember if the called batch calls even more bats then that NEEDS to use call too
|