Today’s blog post will be pretty short and filed under, “Did you know..?”, because, no, I did not know.
Say you have a DOS batch script that runs a MaxL script. To perform some error checking, you check to see if the stderr file file is greater than 0 KB. If so, then do something awesome with the error handling, otherwise, exit the script without incidence. I was pulling out my hair as to why the following would not work (using Sample.Basic as an example):
Why oh why oh why oh why oh why.
I tried adding a pause at the end of the StartMaxL line with a line to echo the errorlevel to see if the script even registered below the MaxL line.
Nope – no errorlevel or pause in the script.
Now, I don’t know what made me think of doing this, but I decided to change “StartMaxL” to “essmsh.exe” to call the shell.
The script now returned an errorlevel code and paused. HUH. I then removed the errorlevel and pause lines and ran the script and the error checking section now worked!
I asked my colleague if he knew that essmsh.exe worked but StartMaxL did not. He said he did know, and added that if you put “call” in front of “StartMaxL”, you will be able to run code below the MaxL line (ie: call StartMaxL).
Tis true, you learn something new every day.