我正在尝试根据机器主机名执行一些命令,但无法正常工作。我希望只有当主机名以“Machine”开头时,命令才会运行。IF 语句是否支持通配符?
@echo off
setlocal enableDelayedExpansion
for /f "usebackq skip=1" %%i in (`wmic computersystem get name`) do (
set name=%%i
goto :done
)
:done
if [%name%]==[MachineXXXX] start "" "%ProgramFiles%\Internet Explorer\iexplore.exe" "download url"
endlocal