Setting the errorlevel in batch file? - TechRepublic
General discussion
June 8, 2000 at 11:28 AM
rejohnson

Setting the errorlevel in batch file?

by rejohnson . Updated 25 years, 9 months ago

I need to reset the errorlevel in a DOS batch file to return a different exit code than set by a command error within the batch file. No user interaction is possible, so I can’t use utilities like DCH or Enquire to set the errorlevel.

Anybody know a utility to do this? I can run another dos program with a predictable exit code like wait.exe, which will reset the errorlevel to 0, but that’s only a partial solution.

Thanks,

Russell

This discussion is locked

All Comments