Created
February 22, 2024 12:06
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem my awesome script | |
exit /b 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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