J
jeeji
Hi
I am relatively new at creating command scripts. I am having troubles
with the errorlevel, and checking whether it contains an erroneous
value (I know it depends on the application called before it)
For example I found that calling
'taskkill' sets the errorlevel to 128
but calling 'rmdir' does not set it at all.
That means that if I have the following command script:
taskkill /IM app.exe
rmdir C:\Temp
if errorlevel 1 echo There is an error
The above echoes "There is an error", even though rmdir does not seem
to set the errorlevel.
I have two questions:
- How do I know which errorlevels are set by which applications
- And what is best practice for the above. Should I know that rmdir
does not set it, and therefore reset it to 0 after the call to
'taskkill'?
Thanks a lot
Jeeji
I am relatively new at creating command scripts. I am having troubles
with the errorlevel, and checking whether it contains an erroneous
value (I know it depends on the application called before it)
For example I found that calling
'taskkill' sets the errorlevel to 128
but calling 'rmdir' does not set it at all.
That means that if I have the following command script:
taskkill /IM app.exe
rmdir C:\Temp
if errorlevel 1 echo There is an error
The above echoes "There is an error", even though rmdir does not seem
to set the errorlevel.
I have two questions:
- How do I know which errorlevels are set by which applications
- And what is best practice for the above. Should I know that rmdir
does not set it, and therefore reset it to 0 after the call to
'taskkill'?
Thanks a lot
Jeeji