I am working on this complicated (for me...) automation and one part is a batch script Started (not Called) from another one.
Now, it\'s all work-in-progress and I\'d l
cmd /c exit 1
will set the errorlevel to 1
.
If you want to have user input errorlevel you can use the choice
command.
@echo off
choice /c 123456789
echo %errorlevel%
Depending on what you type on the order of the choice
command the errorlevel will be set starting at 1
.
example:
choice /c dghet
pressing 'd' will make the errorlevel
1, and pressing h will make the errorlevel
3. Also as a perk you don't need to press enter after the input.