Cronjob.de › Guides › Windows
Cron jobs on Windows: Task Scheduler instead of cron
On Linux you put a cron job into the crontab. Windows has Task Scheduler for that. It starts programs and scripts on a schedule, every minute if you like. This guide shows both ways to get there – by mouse and by command – and when you do not need the Windows machine at all.
Why at all
What is different on Windows
Windows has no cron and no crontab. Its counterpart is Task Scheduler (taskschd.msc), on the command line schtasks. It does not understand crontab expressions such as */5 * * * *. You build schedules from a trigger and a repetition instead.
A scheduled task only runs while the machine is on. If it is asleep, shut down or busy installing updates, the run is lost. On a desktop PC or laptop that is the normal case. And whether a task failed is only shown in its "Last Run Result" – you get no message.
If the task really is the call of an address – a shop export, WordPress, a script on your web space – you do not need the Windows machine for it at all. Cronjob.de then calls the address on schedule, even while the PC is off, with a log and a notification on errors.
- URL to call
https://ihre-domain.de/cron.php?key=…- Recommended interval
- depending on the task, down to every minute
- Tested with
- Windows 10 und 11, Windows Server 2016 bis 2025
- Sufficient Cronjob.de plan
- Only applies to calls from outside: the free plan covers five cron jobs in five-minute steps, minute-precise starts with Cronjob.de Plus.
Setup
Step by step
The AI does it faster
You do not have to transfer any of this by hand. Paste this guide – or the one for your own system – into the assistant, and Cronjob.de fills in address, method, schedule and headers. Where something is unclear it asks instead of guessing. At the end you see what was entered and create the job with one click.
Included in the free plan at no extra cost. You will find it after signing in under "Cronjobs" → "Create with AI".
-
Open Task Scheduler
Press
Windows key + R, typetaskschd.mscand confirm. On the right under "Actions" choose Create Task…. The "Basic Task" next to it cannot repeat every few minutes. -
Set name and user
On the "General" tab you give the task a name. If it should also run while nobody is logged in, choose Run whether user is logged on or not. Windows then asks for the account's password when you save.
-
Schedule as a trigger
On the "Triggers" tab you create a trigger with New…, for example "Daily" at 06:00. For an interval in minutes, also tick Repeat task every:, choose for example 5 minutes and below it "for a duration of: Indefinitely". Values other than the suggested ones can be typed straight into the field, such as
1 minute. -
What gets executed
On the "Actions" tab choose New… and "Start a program". "Program/script" holds the program, "Add arguments" the file. For a PHP script it looks like this:
Program/script: C:\php\php.exe Add arguments: C:\scripts\export.php Start in: C:\scripts
-
Calling an address
If the task should only call an address, use
curl.exe. It has shipped with Windows since Windows 10 (version 1803). Writecurl.exewith the extension: in PowerShellcurlwithout it is a different command.Program/script: C:\Windows\System32\curl.exe Add arguments: -fsS -m 60 https://your-domain.com/cron.php?key=…
-
Missed runs and sleep mode
On the "Settings" tab, Run task as soon as possible after a scheduled start is missed makes up for a lost run. On the "Conditions" tab, Wake the computer to run this task brings the machine out of sleep. On laptops the default "only if the computer is on AC power" there prevents runs on battery.
-
Or by command with schtasks
The same works in a command prompt with administrator rights. The three schedules are alternatives, pick one of them.
/ru SYSTEMruns the task without a logged-in user and without a password.rem every 5 minutes (crontab: */5 * * * *) schtasks /create /tn "Export" /tr "C:\php\php.exe C:\scripts\export.php" /sc minute /mo 5 /ru SYSTEM rem daily at 6 am (crontab: 0 6 * * *) schtasks /create /tn "Export" /tr "C:\php\php.exe C:\scripts\export.php" /sc daily /st 06:00 /ru SYSTEM rem Monday to Friday at 6 am (crontab: 0 6 * * 1-5) schtasks /create /tn "Export" /tr "C:\php\php.exe C:\scripts\export.php" /sc weekly /d MON,TUE,WED,THU,FRI /st 06:00 /ru SYSTEM rem start once now, show status, delete schtasks /run /tn "Export" schtasks /query /tn "Export" /v /fo list schtasks /delete /tn "Export" /f
-
Without a Windows machine: create a cron job at Cronjob.de
If your task can be reached through an address, create a free account at Cronjob.de and enter the address with the schedule you want. The usual crontab notation applies here, and the machine may be switched off.
*/5 * * * *
You can enter this expression at Cronjob.de exactly as it is – the schedule field understands crontab notation. But you do not have to know it: simply click the schedule together instead.
What the five fields of an expression like */5 * * * * mean is explained in the crontab reference – with examples and the most common pitfalls. You can build the expression in the crontab generator. Whether you need an outside service at all is shown in the comparison of the three ways.
Verification
Is it actually running?
In Task Scheduler the "Last Run Result" column shows the return value: 0x0 means success, anything else is an error. Switch on the history on the right with "Enable All Tasks History". When Cronjob.de makes the call, you see every call with status, runtime and response in the log instead, and can get an email when one fails.
FAQ
Common questions about Windows
- Is there a cron job on Windows?
- Not under that name. Its counterpart is Task Scheduler, on the command line
schtasks. It can do everything a cron job can, but writes the schedule as a trigger with a repetition instead of a crontab expression. - How do I translate a crontab expression for Windows?
*/5 * * * *becomes/sc minute /mo 5,0 * * * *becomes/sc hourly,0 6 * * *becomes/sc daily /st 06:00and0 6 * * 1-5becomes/sc weekly /d MON,TUE,WED,THU,FRI /st 06:00. What an expression means exactly is shown by the crontab generator.- Does the task run when I am logged off or the PC is asleep?
- Logged off yes, if it runs "whether user is logged on or not" or as SYSTEM. It only wakes the machine from sleep with the condition "Wake the computer to run this task". If the machine is fully off, the run is lost and made up at the next start with "run task as soon as possible after a scheduled start is missed".
- Can I not just use cron in WSL?
- Yes, the Windows Subsystem for Linux has cron. But it only runs while the Linux environment is running, and depending on your settings Windows shuts that down once no window uses it any more. Without systemd (
systemd=truein/etc/wsl.conf) cron does not start by itself either. For tasks that have to run reliably, Task Scheduler is the safer way. - When is an online cron job better than Task Scheduler?
- When the task is an address and the machine does not run around the clock. Typical are shop exports, WordPress, newsletters or scripts on web space. For tasks that work on files on exactly this machine, Task Scheduler remains the right choice.
Cronjob.de
in the user agent. Ask your host for an exception for it; that is more reliable than allowing IP addresses, because ours can change. Addresses and details in the FAQ.
Other errors such as 401, 404 or 500 are explained in the troubleshooting guide.
Create your cronjob now
Create an account, enter the address, click the schedule. Five cronjobs are free forever, the first 14 days run on the Unlimited plan.
Start for free See pricing