Windows VPSCreate a Scheduled Task on Windows Server
Create a scheduled task via Task Scheduler or PowerShell, run a script with no session open, and check its run history.
On a Windows Server VPS, scheduled tasks automate everything that must run without you: nightly backups, restarting a service, cleaning up logs. It is the equivalent of cron on Linux. This guide covers creation through the interface and through PowerShell, with ready-to-use scripts.
⚙️ Requirements
- A LordHosting VPS running Windows Server with administrator RDP access
- Ideally, IIS installed if you are automating a web server
⚙️ 1. Open Task Scheduler
Press Win + R, type taskschd.msc and confirm. The Task Scheduler Library lists all existing tasks.
⚙️ 2. Create a simple task (interface)
In the right pane, click Create Basic Task, then follow the wizard:
- Name: give a clear name (e.g. "Daily Backup").
- Trigger: choose the frequency (daily, at logon, on event…).
- Action: "Start a program".
- Program/script: the path to your executable or script.
Open the task properties, General tab, and tick "Run whether user is logged on or not". Essential for a task that must run at night.
⚙️ 3. Manage tasks in PowerShell
Faster and scriptable. Create a task that runs a script every night at 3 a.m.:
$action = New-ScheduledTaskAction -Execute "powershell.exe" `
-Argument "-ExecutionPolicy Bypass -File C:\scripts\backup.ps1"
$trigger = New-ScheduledTaskTrigger -Daily -At 3am
Register-ScheduledTask -TaskName "Daily Backup" -Action $action -Trigger $trigger `
-User "SYSTEM" -RunLevel Highest
Manage existing tasks:
Get-ScheduledTask # list tasks
Start-ScheduledTask -TaskName "Daily Backup" # run now
Unregister-ScheduledTask -TaskName "Daily Backup" -Confirm:$false # delete
Want to put this guide into practice on your own server? Windows VPS hosting from €8/month at LordHosting, online in a few minutes.
⚙️ 4. Useful scripts
A compressed backup of a folder:
$date = Get-Date -Format "yyyy-MM-dd"
Compress-Archive -Path "C:\inetpub\mysite" -DestinationPath "D:\backups\site-$date.zip" -Force
Restart a crashed service:
Restart-Service -Name "W3SVC" # the IIS service
Clean up old log files (older than 30 days):
Get-ChildItem "C:\logs" -Recurse -File |
Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-30) } |
Remove-Item -Force
⚙️ 5. Read the run history
In Task Scheduler, select your task then the History tab: every run appears with its return code. Enable history via "Enable All Tasks History" in the right pane if it is empty.
✅ Conclusion
You now know how to automate your Windows VPS: backups, restarts and cleanups run on their own, at night, and you check them in the history. Combine these tasks with an IIS web server for fully automated administration.
Need a reliable Windows server? Our Windows VPS are delivered in minutes with RDP included and full administrator access.
❗Always good to know
Put this guide into practice on your own server
From €8/month. Online in a few minutes, anti-DDoS protection, 7/7 support, no commitment.
Frequently asked questions
Related guides
Secure RDP access on your Windows VPS: port, NLA, firewall, account lockout
Five settings to protect Remote Desktop on a Windows Server VPS: password, NLA, changing port 3389, firewall rule by IP and account lockout.
Connect to your Windows VPS over RDP (PC, Mac, iPhone/Android)
RDP connection to a Windows VPS from Windows (mstsc), Mac and mobile (Windows App): credentials, first start, classic errors and emergency access.
Install IIS on a Windows Server VPS
Enable IIS with one PowerShell command, create your sites, add PHP and HTTPS. Copy-paste commands, from Windows Server 2019 to 2025.
Install MetaTrader 4/5 on a Windows VPS to trade 24/7
Install MT4 or MT5 on a Windows Server VPS, drop in your Expert Advisors, restart the terminal automatically and measure latency to your broker: the complete forex VPS guide.

