读取查询的答案 "wmic"
Reading the answer from the query "wmic"
我无法从命令中读取 return 代码
wmic computersystem where name="%computername%" rename name=aaaaa
关键是,我想将错误通知给将在没有管理员权限的情况下使用它的人。
如何将“ReturnValue = 5”发送到 errorlevel 或 goto?
命令屏幕
How to send "ReturnValue = 5" to errorlevel or goto?
for /f "skip=2 tokens=2 delims==;" %%a in ('wmic computersystem where name^="%computername%" rename name^=aaaaa 2^>nul') do cmd /c exit %%a
echo %errorlevel%
或 GOTO
:
wmic computersystem where name="AKOYA-P4" rename name=aaa |find "ReturnValue = 5;" >nul && goto :label
我无法从命令中读取 return 代码
wmic computersystem where name="%computername%" rename name=aaaaa
关键是,我想将错误通知给将在没有管理员权限的情况下使用它的人。
如何将“ReturnValue = 5”发送到 errorlevel 或 goto?
命令屏幕
How to send "ReturnValue = 5" to errorlevel or goto?
for /f "skip=2 tokens=2 delims==;" %%a in ('wmic computersystem where name^="%computername%" rename name^=aaaaa 2^>nul') do cmd /c exit %%a
echo %errorlevel%
或 GOTO
:
wmic computersystem where name="AKOYA-P4" rename name=aaa |find "ReturnValue = 5;" >nul && goto :label