尝试通过在powershell中运行psexec来运行脚本以在多台计算机上删除CS6。删除CS6(将XML文件附加到本地安装的安装文件)的命令在命令行中使用psexec运行时有效,但在使用Powershell时失败。我为每台机器得到的错误是
“C:\ Program Files(x86)\ Common Files \ Adobe \ OOBE \ PDApp \ DWA \ Setup.exe 退出VM08002745E4AD,错误代码为16。“
有什么想法吗?
下面的脚本
#get list of computers
$computers = gc "C:\Remove CS6\adobe_cs6_hosts.txt"
#Loop through each computer
Foreach ( $computer in $computers )
{
#copy XML file
Copy "C:\Remove CS6\uninstall-en_IL.xml" "\\$computer\c$" -force
#Uninstall CS6
try
{
"$computer attempting 32 bit uninstall"
$output = cmd /c "psexec \\$computer `"C:\Program Files\Common Files\Adobe\OOBE\PDApp\DWA\Setup.exe`" --mode=Silent --deploymentFile=`"\\$computer\c$\uninstall-en_IL.xml`" 2>&1"
"$computer $output"
}
catch
{
"$computer attempting 64 bit uninstall"
}
try
{
$output = cmd /c "psexec \\$computer `"C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\DWA\Setup.exe" --mode=Silent --deploymentFile="\\$computer\c$\uninstall-en_IL.xml`" 2>&1"
"$computer $output"
}
catch
{
"Failed to uninstall CS6"
}
}
pause
Foreach ( $computer in $computers )
{
#Delete uninstall.xml
Remove-item “\\$computer\c$\uninstall-en_IL.xml”
}
答案 0 :(得分:0)
原来我需要摆脱双连字符,例如`--