Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oledid/68fa3c8312704fc4bdf499876fe19c48 to your computer and use it in GitHub Desktop.
Save oledid/68fa3c8312704fc4bdf499876fe19c48 to your computer and use it in GitHub Desktop.
Run cmd from task scheduler without flashing console window.md

Windows: I want to run a command line script from task scheduler without opening a console window. How?

Task scheduler:

  • Program/script: powershell.exe
  • Add arguments: -windowstyle hidden -command "C:\Full\Path\To\Script.cmd"
  • Start in: (optional)

Also, set powershell execution policy first to be able to run powershell scripts

There are other ways to solve this, but this will let you "Run only when user is logged on".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment