What’s the first thing you, as an IT professional, ask a customer who is experiencing a technical issue? Let us guess… “Did you try restarting your device?” Does your customer roll their eyes and say yes, only to then go ahead and try restarting again at your insistence and then suddenly the issue is gone?
Want to solve the eye-roll problem AND the reboot problem at the same time?
Boy, do we have the script for you. The below script lets you shut down or restart both local and remote devices one at a time. This can be super useful when you want to restart a device after running an installation script — plus it runs on all Windows versions, including Windows 11!
### Shutdown /r /f ###
Will data from running programs be lost if I force restart the device?
The /f command may cause data loss if you restart the device while the programs are still running. We therefore recommend that all important data be saved before running the force restart script.
Can I set a device to restart at a specific time?
While you can’t set a device to restart at a specific time, you can enable a countdown timer by adding the command /t <xx> ; with x representing the time in seconds until the device restarts.
- /r command automatically restarts the computer after shutdown.
- /f command forces running applications to close — without warning the user — which may result in data loss.
- Shutdown /r /f command will shutdown the device, force running applications to close, and restart the device after shutdown.
- /m \\<computername> Add this command to the script to target remote computers
- /t <xx> Add this command to the script to set a countdown (measured in seconds) until the device restarts. For example, /t 0 will instantly restart the device whereas /t 20 will restart the device in 20 seconds.
Explore our shared script library
The all-in-one IT management platform that will take your IT operations to the next level!