DEV Community

Dênis Mendes
Dênis Mendes

Posted on • Edited on

2 3

Schedule a job on Windows

Hey there!

I use macOS on a daily basis but I'm working into a multi-platform application which runs on Windows and Linux then I needed to schedule a job the first time on Windows and I found that application called Schtasks.exe that helps to create and manage schedule jobs into Windows.

So if you wanna schedule a job to run every 5 minutes you can run that command line on terminal:

schtasks /create /sc minute /mo 5 /tn "Open MyProgram" /tr "c:\Users\admin\AppData\Local\Programs\myprogram.exe"
Enter fullscreen mode Exit fullscreen mode

And then if you want to stop that schedule job you can run:

schtasks /delete /tn "Open MyProgram"
Enter fullscreen mode Exit fullscreen mode

UPDATE #1:

If you want to force a command line above so use /f at the end of the command line.

There are many other parameters and you can see here: https://docs.microsoft.com/en-us/windows/win32/taskschd/schtasks

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks-create

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay