尝试使用带有 RUNAS 的 wmic 卸载(脚本)

时间:2021-05-05 15:38:48

标签: windows batch-file cmd wmic

我正在尝试为 unistall 编写脚本,并以本地管理员身份从非管理员域用户那里安装程序。

cmd /C runas /noprofile /user:LocalPC\localuser "wmic product where name="software" call uninstall /nointeractive

该命令运行良好,但是当我尝试执行脚本时不起作用,要么出现错误,要么不要卸载程序

代码是

Set-Content "C:\script\unistall.bat -value 'wmic product where name="software" call uninstall /nointeractive'
cmd /C runas /noprofile /user:localpc\localuser "C:\script\unistall.bat"

知道为什么程序不卸载吗?

0 个答案:

没有答案
相关问题