Run Powershell scheduled task without pop up

I found this solution a while back by calling the PowerShell Script via a .VBS script. Not ideal but, it negates the window flash:

command = "powershell.exe -nologo -command C:\Scripts\YourScript.ps1"  
set shell = CreateObject("WScript.Shell")
shell.Run command,0

Schedule this .VBS in the task scheduler and it will call your script the same as before.

打赏
Liked it? Take a second to support admin on Patreon!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.