|
|
Browse by Tags
All Tags » microsoft » dos » batch
-
Came across a definite gotcha today in batch file programming, when I noticed that we had SET ERRORLEVEL=0 in one of our batch files. Turns out that once you set this variable explicitly then any command you run after will not be able to change the value of the %ERRORLEVEL% variable. E.G.
C:\>dir AUTOEXEC.BAT
Volume in drive C has no ...
-
After much trial and tribulation today I've finally cracked how to return a non zero exit code from a call to osql back to a dos batch file.
The answer is as follows. Note the bits in bold below are most important, and the use of the single & sign to denote running the IF ERRORLEVEL 1 command even if the previous osql command ...
|
|
|