使用 WMIC 查找版本然后运行相应的操作

使用 WMIC 查找版本然后运行相应的操作

我想运行批处理来找出 Symantec End Point 的哪个版本,以便执行更新或升级操作。我在执行以下脚本时收到错误 - 没有可用的实例请帮助查看如何更正它。

set latestVersion=14.3.5427.3000
for /f "skip=2 tokens=2 delims== " %%i in ('wmic product where "Name like 'Symantec End 
Point'" get version /format:Textvaluelist') do set currentversion=%%i

echo %currentversion%
Pause
if %currentVersion%==%latestVersion% goto update
if %currentVersion% GEQ %latestVersion% goto update
if %currentVersion% LEQ %latestVersion% goto upgrade

相关内容