RunSynchronousCommand (runsynchronous-RunSynchronousCommand) RunSynchronousCommand (microsoft-windows-deployment-runsynchronous-runsynchronouscommand)

RunSynchronousCommand 指定要在指定的配置阶段运行的单个命令。RunSynchronousCommand specifies a single command to run during the specified configuration pass.

若要启动在其他命令可以启动之前需要完成的命令,请使用同步命令。To start a command that needs to finish before other commands can start, use synchronous commands. 若要运行可同时启动的服务或命令,请改用 RunAsynchronousTo run services or commands that can start at the same time, use RunAsynchronous instead.

RunSynchronous 命令始终在相同传递中的命令之前运行。RunSynchronous commands always run before commands in the same pass. RunSynchronous 命令在 auditUser 配置阶段中的用户上下文中运行,并在 specialize 配置阶段的系统上下文中运行。RunSynchronous commands run in the user context in the auditUser configuration pass configuration pass and in the system context in the specialize configuration pass.

警告

不要添加关闭或重新启动计算机的命令;相反,请使用以下设置: \ RunSynchronous \ RunSynchronousCommand \ WillRebootDo not add commands that shut down or reboot the computer; instead, use the setting: Microsoft-Windows-Deployment\RunSynchronous\RunSynchronousCommand\WillReboot.

子元素Child Elements

设置Setting 说明Description
凭据Credentials 指定访问路径时要使用的凭据。Specifies the credentials to use when accessing paths.
说明Description 指定要运行的命令的说明。Specifies a description of the command to run.
OrderOrder 指定要运行的命令的顺序。Specifies the order of the command to run.
路径Path 指定要运行的命令的路径。Specifies the path to the command to run.
WillRebootWillReboot 指定运行同步命令后在什么情况下重新启动计算机。Specifies in what circumstances to restart the computer after running a synchronous command.

有效的配置阶段Valid Configuration Passes

auditUserauditUser

specializespecialize

父层次结构Parent Hierarchy

Microsoft-Windows 部署 | RunSynchronous | RunSynchronousCommandMicrosoft-Windows-Deployment | RunSynchronous | RunSynchronousCommand

适用于Applies To

有关此组件支持的 Windows 版本和体系结构的列表,请参阅 Microsoft-Windows 部署For the 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.

<RunSynchronous>
   <RunSynchronousCommand wcm:action="add">
      <Credentials>
         <Domain>MyDomain</Domain>
         <Password>MyPassword</Password>
         <Username>MyUsername</Username>
      </Credentials>
      <Description>MySynchCommand1</Description>
      <Order>1</Order>
      <Path>\\network\server\share\filename</Path>
      <WillReboot>OnRequest</WillReboot>
   </RunSynchronousCommand>
   <RunSynchronousCommand wcm:action="add">
      <Credentials>
         <Domain>MyDomain</Domain>
         <Password>MyPassword</Password>
         <Username>MyUsername</Username>
      </Credentials>
      <Description>MySynchCommand2</Description>
      <Order>2</Order>
      <Path>\\network\server\share\filename</Path>
      <WillReboot>OnRequest</WillReboot>
   </RunSynchronousCommand>
</RunSynchronous>

RunSynchronousRunSynchronous

RunAsynchronousRunAsynchronous