11.01.2020
Posted by admin
Here’s an example of a batch file that does a few common things:@ECHO OFF@rem 'pushd $dir ' puts $dir on directory stackpushd.SET COMMENT =%1IF NOT DEFINED COMMENT SET COMMENT = 'SET FOO = 'bar'IF%FOO% 'bar' goto ISBARecho The above should always be truegoto END:ISBARnmake -f Makefile.vcIF ERRORLEVEL 1 goto ERRONEORHIGHERecho Compilation successful!goto END:ERRONEORHIGHERecho Compilation failed!goto END:END@rem popd pops the directory name from the stack and does cd therepopd.