所以每次我运行我的批处理文件时,输入计算机名称,然后键入我要查找的程序。我添加了“name like'(word)%'”部分,因此它不需要完全匹配来查找程序。这是我的代码:
@echo off
set /p name="Enter PC Name: "
set /p prgm="Type Part of the Program Name: "
wmic /node:%name% product where "name like '%prgm%%'" get name,version
set /p fprgm="Enter Full Program Name: "
wmic /node:%name% product where name="%fprgm%" call uninstall
pause
我不确定最新情况,因为如果我手动进入WMIC并使用/node:(pc-name) product where "name like '(word)%'" get name,version
进行搜索,那就可以了。