RunSynchronousCommand

Applies To: Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista

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. To run services or commands that can start at the same time, use RunAsynchronous instead.

RunSynchronous commands always run before commands in the same pass. RunSynchronous commands run in the user context in the auditUser configuration pass configuration pass and in the system context in the specialize configuration pass.

Warning

Do not add commands that shut down or reboot the computer; instead, use the setting: Microsoft-Windows-Deployment\RunSynchronous\RunSynchronousCommand<A href="ff716371(v=win.10).md">WillReboot.

Child Elements

Credentials

Specifies the credentials to use when accessing paths.

Description

Specifies a description of the command to run.

Order

Specifies the order of the command to run.

Path

Specifies the path to the command to run.

WillReboot

Specifies in what circumstances to restart the computer after running a synchronous command.

Valid Configuration Passes

auditUser

specialize

Parent Hierarchy

Microsoft-Windows-Deployment | RunSynchronous | RunSynchronousCommand

Applies To

For the list of the Windows editions and architectures that this component supports, see Microsoft-Windows-Deployment.

XML Example

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>

See Also

Concepts

RunSynchronous
RunAsynchronous