Skip to content

Instantly share code, notes, and snippets.

@alsolovyev
Created February 22, 2024 12:06
Show Gist options
  • Save alsolovyev/1d641c4b0c62e3a317b5272effa00cda to your computer and use it in GitHub Desktop.
Save alsolovyev/1d641c4b0c62e3a317b5272effa00cda to your computer and use it in GitHub Desktop.
Execute a script (batch, powershell, etc) in hidden mode every N minutes using the Windows 10/11 Task Scheduler
@echo off
rem After triggered, repeat every 10 minutes indefinitely
schtasks /create /tn "My task name" /tr "wscript.exe C:\task.vbs" /sc minute /mo 10
@echo off
rem my awesome script
exit /b 0
Dim WinScriptHost
Set WinScriptHost = CreateObject("WScript.Shell")
WinScriptHost.Run Chr(34) & "C:\script.bat" & Chr(34), 0
Set WinScriptHost = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment