Skip to content

Instantly share code, notes, and snippets.

@otuva
Created June 19, 2024 09:32
Show Gist options
  • Save otuva/0b89e3f1958500018e4cc57106fd850a to your computer and use it in GitHub Desktop.
Save otuva/0b89e3f1958500018e4cc57106fd850a to your computer and use it in GitHub Desktop.
# Scheduler Task that runs automatically on the start //// https://stackoverflow.com/a/56614411
schtasks /create /tn "FileMonitor" /sc onstart /delay 0000:30 /rl highest /ru system /tr "powershell.exe -file C:\Doc\Files\FileMonitor.ps1"
# You can list the task like this
schtasks /Query /TN "FileMonitor" /V /FO List
# or delete it
schtasks /Delete /TN "FileMonitor"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment