print exit code in cmd in windows os [duplicate]

本小妞迷上赌 提交于 2019-12-08 14:35:23

问题


print exit code in cmd in windows os ....some command return exit code ...where this code store...and i want to print this exit code and assign it to variable


回答1:


You can use %ERRORLEVEL% environment variable, it will hold the last code that was returned. You can echo it or assign it to a variable, depending on your needs.



来源:https://stackoverflow.com/questions/3819513/print-exit-code-in-cmd-in-windows-os

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!