希望编写一个脚本来查询 wmic 计算机系统获取模型,如果该值是 true 则继续使用批处理文件如果不是 true echo 不兼容的系统退出,这就是我到目前为止所拥有的
@echo off
for /F "skip=1" %%? in ('wmic computersystem get model') do "(
if %%?' equ Test' ('goto start') else (
if %%?' equ test1' ('goto start') else (
if %%?' equ test2' ('goto start') else (
if %%?' equ test3' ('goto start') else (
echo un-compatible System Exiting...>nul)))))"
:start
start of script
Run Code Online (Sandbox Code Playgroud)
我通常对脚本编写没问题,但从未使用过 if 语句,所以在这个方面有点迷失。
任何帮助都将受到非常欢迎。