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

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

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

Okay