tocOn this page 7 sections
To stop Windows Update from restarting a trading VPS during market hours, set it to download updates but not install them on its own (AUOptions 3, or 7 on Windows Server 2016 and later). Then run a scheduled install-and-reboot job while the markets are closed at the weekend. Active hours can help, but they cap at 18 hours, so on their own they can't protect a 24/5 forex or futures session.
Why active hours aren't enough
Active hours tell Windows not to restart automatically inside a set window. The window can be at most 18 hours long, and forex trades almost around the clock from Sunday evening to Friday evening. That leaves at least 6 hours each weekday when Windows may restart to finish an update. If your EAs or strategies run on a Windows VPS for forex trading or on a futures trading VPS, those hours can fall during a live position. Keep active hours as a backup layer. The real fix is to stop Windows from installing updates on its own.
Step 1: Check the server's time zone
Every time below is the server's local time. Connect over RDP, open PowerShell as Administrator and run:
Get-TimeZone
Get-Date
Many VPS images default to UTC. Work out how the market close and open translate to this clock before you schedule anything.
Step 2: Switch to download-and-notify
On a standalone VPS that isn't joined to a domain, write the Windows Update policy values directly to the registry:
$au = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
New-Item -Path $au -Force | Out-Null
Set-ItemProperty -Path $au -Name NoAutoUpdate -Value 0 -Type DWord
Set-ItemProperty -Path $au -Name AUOptions -Value 3 -Type DWord
Set-ItemProperty -Path $au -Name NoAutoRebootWithLoggedOnUsers -Value 1 -Type DWord
Restart-Service wuauserv
- AUOptions = 3 downloads updates automatically and waits for you to install them.
- AUOptions = 7 is available on Windows Server 2016 and later. It downloads automatically, then waits for you to install and to restart. Use it if your edition supports it.
- NoAutoRebootWithLoggedOnUsers = 1 is an extra safeguard for scheduled installs while someone is signed in. Don't rely on it alone: a disconnected RDP session may not count as signed in.
If you prefer the GUI, run gpedit.msc and go to Computer Configuration > Administrative Templates > Windows Components > Windows Update. On newer templates, open the Manage end user experience subfolder. Set Configure Automatic Updates to Enabled with option 3 (or 7). Then enable No auto-restart with logged on users for scheduled automatic updates installations and run gpupdate /force.
On Windows Server 2019 and later you can also run sconfig and set the Windows Update setting to DownloadOnly or Manual.
Step 3: Set active hours as a backup
$ux = 'HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings'
Set-ItemProperty -Path $ux -Name ActiveHoursStart -Value 6 -Type DWord
Set-ItemProperty -Path $ux -Name ActiveHoursEnd -Value 23 -Type DWord
Point these 17 hours at your busiest trading period. You can see the same values under Settings > Windows Update > Advanced options on builds that show that page.
Step 4: Patch on a weekend schedule
Skipping updates for good leaves an internet-facing server exposed, so plan a patch window instead. The free PSWindowsUpdate module from the PowerShell Gallery handles the install:
Install-Module PSWindowsUpdate -Scope AllUsers -Force
New-Item -ItemType Directory -Path C:\Logs -Force | Out-Null
$cmd = 'Import-Module PSWindowsUpdate; Install-WindowsUpdate -AcceptAll -AutoReboot | Out-File C:\Logs\wu.log -Append'
$action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument "-NoProfile -ExecutionPolicy Bypass -Command $cmd"
$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Saturday -At 10:00
Register-ScheduledTask -TaskName 'Weekend Patching' -Action $action -Trigger $trigger -User 'SYSTEM' -RunLevel Highest
Saturday morning gives the server most of the weekend to install, reboot and settle. If an update fails, you still have time to fix it before the Sunday open. Run Get-WindowsUpdate by hand once first to make sure the module can reach the update service.
Step 5: Verify and monitor
Confirm the policy took effect and check for a pending restart:
Get-ItemProperty 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired'
Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending'
If either Test-Path returns True on a weekday, an update is already waiting for a restart. Close your positions and reboot by hand at a quiet moment instead of leaving it to chance. To find out what restarted the server in the past, look up event ID 1074 in the System log:
Get-WinEvent -FilterHashtable @{LogName='System'; Id=1074} -MaxEvents 10 |
Format-List TimeCreated, Message
Even a planned weekend reboot needs your terminals to come back up without you. Pair this setup with auto-restarting MT4 and MT5 after a reboot so your EAs are running again before Monday.
FAQ
Should I just disable the Windows Update service?
No. Stopping or disabling wuauserv also blocks security fixes, and Windows components can turn it back on. Download-and-notify plus a weekend schedule keeps the server patched without surprise restarts.
Do Defender definition updates restart the server?
No. Microsoft Defender signature updates install without a restart. The reboots that interrupt trading come from cumulative and servicing stack updates.
My VPS still restarted during the week. Why?
Check event 1074 to see which process started the restart. Common causes are a domain Group Policy overriding your local settings, someone choosing restart in a notification, or a restart started from the host side. If it was Windows Update, confirm that AUOptions is still set to 3 or 7.
Run this on your own Windows VPS
Get a Windows VPS from WindowsVPS in about 60 seconds, with full Administrator access over RDP, NVMe storage and the Windows license included.
Written by the WindowsVPS Team
We run Windows Server VPS hosting and write these guides from the same setups our customers use: RDP, PowerShell, trading terminals and always-on bots. Questions about a guide? Contact us.