我正在尝试为 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"
知道为什么程序不卸载吗?