Four methods to schedule automatic restarts on a Windows VPS: Task Scheduler, Command Prompt, Group Policy Editor, and Registry Editor.
There are several ways to set up automatic restarts in Windows depending on your needs.
1. Using Task Scheduler (Recurring Schedule)
Best for scheduling regular restarts (daily, weekly, monthly).
- Press Win + R, type
taskschd.msc, press Enter - Click Create Basic Task in the right panel
- Give the task a name (e.g. Auto Restart), click Next
- Choose the frequency: Daily, Weekly, or Monthly
- Set the start time and date
- Select Start a Program, click Next
- In Program/script, type:
shutdown - In Add arguments, enter:
/r /f /t 0/r= Restart/f= Force close all apps/t 0= No delay
- Click Finish
2. Using Command Prompt (One-Time)
Best for scheduling a single restart without setting up Task Scheduler.
# Restart in 1 hour (3600 seconds)
shutdown /r /f /t 3600
# Restart in 10 minutes
shutdown /r /f /t 600
# Cancel a scheduled restart
shutdown /a
3. Using Group Policy Editor (Network)
Best for administrators managing restarts across multiple computers.
- Press Win + R, type
gpedit.msc, press Enter - Navigate to:
Computer Configuration > Administrative Templates > Windows Components > Windows Update - Find No auto-restart with logged on users for scheduled automatic updates
- Set it to Enabled so Windows only restarts when no users are logged in
- Click Apply β OK
4. Using Registry Editor (Prevent Automatic Restarts)
Best for preventing Windows from restarting automatically after updates.
- Press Win + R, type
regedit, press Enter - Navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU - Create a new DWORD (32-bit) Value named
NoAutoRebootWithLoggedOnUsers - Set Value data =
1 - Restart the computer to apply changes
Summary
| Method | Best for |
|---|---|
| Task Scheduler | Recurring automatic restarts |
| Command Prompt | One-time scheduled restart |
| Group Policy Editor | Network-wide restart control |
| Registry Editor | Preventing restarts after updates |