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

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

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

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay