Last active
May 24, 2021 13:12
-
-
Save losophy/124ed80a9195048bbca03fece3ac9daf to your computer and use it in GitHub Desktop.
cmd 错误等级控制
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo off | |
python errorlevel.py | |
echo %ERRORLEVEL% | |
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
print("dfsdf") | |
sys.exit(-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ping 61.152.XX.XX | |
IF ERRORLEVEL 1 echo aa | |
IF ERRORLEVEL 0 echo bb | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment