WillReboot
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
WillReboot
specifies in what circumstances to restart the computer after running a synchronous command.
If there are any additional commands that have yet to be processed before the computer restarts, those commands are saved. After the restart, the remaining synchronous commands resume.
RunSynchronous commands run in the user context in the auditUser configuration pass and in the system context in the specialize pass.
Values
Always |
Specifies that the computer always restarts immediately after the command has run. |
OnRequest |
Specifies that the computer restarts after the command has run, if requested. See the Remarks for a table of possible return codes. |
Never |
Specifies that the computer does not restart after the command has run. This is the default value. |
Remarks
If the value of WillReboot
is OnRequest, the synchronous command must return one of the following codes.
Return code | Description |
---|---|
0 |
The command was successful. No reboot is required. |
1 |
The command was successful. An immediate reboot is required. Then, the next command can be started. |
2 |
The command is still in process. An immediate reboot is required. Then, the same command must be restarted. This code can be returned multiple times. |
Other codes |
The command failed. An error must be returned and installation terminated. |
Valid Passes
auditUser
specialize
Parent Hierarchy
Microsoft-Windows-Deployment | RunSynchronous | RunSynchronousCommand | WillReboot
Applies To
For the list of the supported 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>