具有特殊字符的电源外壳"cmd.exe /c"



我想使用以下代码:

cmd.exe /c "C:Program FilesCommon FilesMicrosoft SharedVSTO10.0VSTOInstaller.exe" /install "file:///C:/Program Files (x86)/Addin.vsto"

而且无论我如何加上引号,我都无法让它工作"(x86)"部分会杀死它。如果有人能让它工作,将不胜感激。

为什么要使用 cmd 来调用安装程序?

下面是一个使用联接路径 cmdlet 组合安装程序路径并直接调用它的示例:

$installerPath = Join-Path $env:CommonProgramFiles 'microsoft sharedVSTO10.0VSTOInstaller.exe'
$parameter = @('/install', 'file:///C:/Program Files (x86)/Addin.vsto')
& $installerPath @parameter

最新更新