Cronjob.de › Guides › Windows
Cron jobs on Windows: Task Scheduler instead of cron
On Windows you set up a cron job with Task Scheduler: open taskschd.msc or use schtasks on the command line, for example schtasks /create /sc minute /mo 5 for every 5 minutes. If the task is only the call of an address, you do not need the Windows machine at all. A service such as Cronjob.de then calls the address, even while the PC is off.
Updated:
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 restarting for updates, the run is lost. On a desktop PC or laptop that is the normal case. Whether a task failed is shown in its "Last Run Result". Task Scheduler does not notify you by itself.
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. Cronjob.de then calls the address on schedule, even while the PC is off, with a log and, if you like, 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 "Create Basic Task" wizard next to it does not ask for a repetition 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. According to Microsoft it ships with Windows 10 from build 17063, that is from version 1803. Writecurl.exewith the extension: in Windows PowerShell 5.1,curlwithout it is an alias forInvoke-WebRequest.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.
/sc minute /moaccepts 1 to 1439 minutes./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. Click the interval or describe it in one sentence, such as "weekdays at 6 am". There is no program, no arguments and no power settings to deal with, 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 and runtime in the log instead, and from the Plus plan 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 starts programs and scripts on a schedule, 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 distribution is running. According to Microsoft, WSL shuts down an idle distribution after a timeout (setting
instanceIdleTimeout, default 15 seconds). Without systemd cron does not start by itself either; that needssystemd=truein the[boot]section of/etc/wsl.conf. 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 pricingMore guides
- Webspace
- WordPress
- Nextcloud
- Contao
- Drupal
- Joomla
- All-Inkl (KAS)
- STRATO
- IONOS
- Matomo
- Dolibarr
- phpList
- SuperWebMailer
- Firefly III
- Host Europe
- Hetzner Webhosting
- Gambio
- Shopware
- JTL-Shop
- PrestaShop
- Moodle
- WooCommerce
- WP All Import
- Doofinder
- GitHub Actions
- MySQLDumper
By Joscha Schultze, operator of Cronjob.de · Written with AI assistance.