Skip to content

Windows Task Scheduler Headless Script

!! Scheduled task might not run properly when Path contains a space !!

DOS

  • Create a Task Scheduler task
  • Actions tab: Start a program
  • Program/script: C:\Windows\System32\conhost.exe
  • Add arguments (optional): --headless cmd.exe /C "...your\full\command\path_here\your_command_here"
  • Start in (optional): ...your\full\command\path_here

PowerShell

  • Create a Task Scheduler task
  • Actions tab: Start a program
  • Program/script: powershell.exe
  • Add arguments (optional): -NoProfile -ExecutionPolicy Bypass -Command "Start-Process 'Drive:\Path\To\Script\YourScript.bat' -WindowStyle Hidden"
  • Start in (optional): Drive:\Path\To\Script

More on creating a scheduled tasks via CLI