How to run any program in Task Scheduler

Windows Task Scheduler is great for running background tasks, but a little confusing.

If you just want to trigger a Windows batch file periodically you don’t need this guide. This guide will explain how to run any software without using a batch file. In other words, you can run any software directly from within Task Scheduler without triggering a script file.

  • Click on Start and type taskschd and hit Enter.
  • Right-click on the Task Scheduler Library and click on Create Basic Task.
  • Fill in the required fields in the wizard and select Start a program.
  • In the next window enter the following example:
  1. Program/script: cmd
  2. Argument: For example: /c "echo hello world > test.txt". Note the /c ! Or another example: /c "D:\scripts\some_script\main.py"
  3. Start in: %userprofile%\Desktop or the location of the script.

Note the /c before your command. This is important.

The “Start in” path should not have quotation marks. Neither should cmd. Remember to add quotation marks around the command you wish to run. In this case "echo hello world > test.txt"!

This example will make a file called test.txt on your desktop with the content “hello world”, but you could use any CLI commands here.

As shown in the example, the key here is launching cmd with the /c parameter. This will make cmd carry out the argument command specified in the argument input.

Also, note that the argument should be enclosed in quotation marks.

If you want you can also enable the script to “Run whether user is logged on or not”. This means that if the computer is started, but no user is logged in, the script will launch regardless. It also means the script window will stay hidden during a script run.

Knowing this you can run any software as a Scheduled task. Be it Python, Docker, any software like FFmpeg, Image Magick, or what have you! 😁

Leave a Reply

Your email address will not be published. Required fields are marked *