路徑 (microsoft-windows-部署-runsynchronous-runsynchronouscommand-path) Path (microsoft-windows-deployment-runsynchronous-runsynchronouscommand-path)

Path 指定要執行之命令的路徑和名稱。Path specifies the path and the name of the command to run. RunSynchronous 命令會在 auditUser 設定階段的使用者內容和 specialize 設定階段的系統內容中執行。RunSynchronous commands run in the user context in the auditUser configuration pass and in the system context in the specialize configuration pass.

警告Warning
請勿新增關閉或重新開機電腦的命令;請改用設定: Microsoft-Windows-Deployment \ RunSynchronous \ RunSynchronousCommand \ WillRebootDo not add commands that shut down or reboot the computer; instead, use the setting: Microsoft-Windows-Deployment\RunSynchronous\RunSynchronousCommand\WillReboot.

Values

路徑Path

指定要同步執行之命令的路徑和檔案名。Specifies the path and the file name of the command to run synchronously. 路徑可以是本機路徑或 UNC 路徑。The path can be a local path or a UNC path. 如果路徑是 UNC 路徑,則必須指定 認證If the path is a UNC path, the Credentials must be specified. 路徑 是最大長度為259個字元的字串。Path is a string with a maximum length of 259 characters.

這種字串不支援空的元素。This string type does not support empty elements. 請勿為這種字串建立空值。Do not create an empty value for this setting.

有效的設定階段Valid Configuration Passes

auditUserauditUser

特殊化specialize

父階層Parent Hierarchy

Microsoft-Windows-部署 | RunSynchronous | RunSynchronousCommand | 路徑Microsoft-Windows-Deployment | RunSynchronous | RunSynchronousCommand | Path

套用至Applies To

如需此元件所支援的 Windows 版本和架構清單,請參閱 Microsoft windows-部署For a list of the Windows editions and architectures that this component supports, see Microsoft-Windows-Deployment.

XML 範例XML Example

下列 XML 輸出顯示如何設定同步命令。The following XML output shows how to set synchronous commands.

第一個命令會在本機硬碟上執行應用程式。The first command runs an application on the local hard drive. 此命令包含環境變數% ProgramFiles%。The command includes the environment variable %ProgramFiles%. 第二個命令會從網路執行命令。The second command runs a command from the network.

<RunSynchronous>
   <RunSynchronousCommand wcm:action="add">
      <Description>Command1-Local</Description>
      <Order>1</Order>
      <Path>%ProgramFiles%\FabriKam\FabriKam First Run Application.exe</Path>
      <WillReboot>OnRequest</WillReboot>
   </RunSynchronousCommand>
   <RunSynchronousCommand wcm:action="add">
      <Credentials>
         <Domain>MyDomain</Domain>
         <Password>MyPassword</Password>
         <Username>MyUsername</Username>
      </Credentials>
      <Description>Command2-Network</Description>
      <Order>2</Order>
      <Path>\\network\server\share\filename</Path>
      <WillReboot>OnRequest</WillReboot>
   </RunSynchronousCommand>
</RunSynchronous>

RunSynchronousCommandRunSynchronousCommand