首页 > 解决方案 > 使用参数启动进程

问题描述

我正在尝试创建一个允许用户开始在线修复 Office 的脚本,我正在检查他们是否有 32 位或 64 位然后是语言。

我制作了以下脚本,但没有任何反应,我不知道为什么

$culture = (Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration)."ClientCulture"
$platform = (Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration)."Platform"

$CMD = "C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeClickToRun.exe"

Start-Process -FilePath $CMD -ArgumentList @("scenario=Repair", "platform=$platform", "culture=$culture", "forceappshutdown=True", "RepairType=FullRepair", "DisplayLevel=True") -Wait

标签: stringpowershell

解决方案


推荐阅读