How to raise (lower) errorlevel in scripts?
This is really common question - how can I raise/lower errorlevel in batches using integrated tools?
In fact there is really simple answer to this question:
Resetting errorlevel:
Just use command
Verify > nul
It will automatically "reset" errorlevel back to normal
Increasing errorlevel to 1:
We can use verify command again:
Verify blablabla 2>nul
Because verify dont know blablabla parameter, it will automatically increase errorlevel to 1.
Do you find it userful? There are many different methods how to increase errorlevel - share your favourite :)