How to Automatically Restart on a Windows VPS

To regulate automatic restart On Windows, there are several methods you can use, depending on your needs. Here are some methods you can apply:


1. Using Task Scheduler

If you want to schedule an automatic restart periodically, follow these steps:

  1. Press Win + R, type taskschd.msc, then press Enter to open Task Scheduler.
  2. Click Create Basic Task in the right panel.
  3. Give the task a name, for example Automatic Restart, then click Next.
  4. Select the desired time:
    • Daily (Daily)
    • Weekly (Weekly)
    • Monthly (Monthly)
  5. Specify the start time and date of the task.
  6. Choose Start a Program, then click Next.
  7. In the section Program/script, type: shutdown
  8. On Add arguments, insert: /r /f /t 0
    • /r = Restart
    • /f = Force close all applications
    • /t 0 = Restart without pause
  9. Click Finish to save the task.

2. Using Command Prompt (CMD)

If you only want to schedule a restart once without having to set it in Task Scheduler, use the following command:

  • Restart in 1 hour (3600 seconds): shutdown /r /f /t 3600
  • Restart in 10 minutes: shutdown /r /f /t 600
  • Cancel restart which has been scheduled: shutdown /a

3. Using Group Policy Editor (GPO)

This method is suitable for network admins who want to set up automatic restarts on multiple computers.

  1. Press Win + R, type gpedit. msc, then press Enter.
  2. Go to: Computer Configuration > Administrative Templates > Windows Components > Windows Update
  3. Search options No auto-restart with logged on users for scheduled automatic updates.
  4. Change the settings to enabled so that Windows only restarts when no users are active.
  5. Click apply Then OK.

4. Using Registry Editor

If you want to prevent Windows from automatically restarting after an update:

  1. Press Win + R, type regedit, then press Enter.
  2. Go to: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
  3. If it doesn't exist, create a DWORD (32-bit) Value with the name NoAutoRebootWithLoggedOnUsers.
  4. Set Value data become 1.
  5. Restart the computer to apply the changes.

Conclusion

  • Task Scheduler = for periodic automatic restart.
  • CMD = for a one-time scheduled restart.
  • GPO = for control in corporate networks.
  • Registry Editor = to prevent restart after update.

Which method do you want to use? 😊

TUTORIAL

Other