Alex Rivera | Logout

Run a powershell script in the background once per minute

Asked 2010-01-15T12:46:15.683
45

I want a powershell script to be run once per minute in the background. No window may appear. How do I do it?

Edit
Report

1 Answer

28

Schedule your task to be run as System. The command below will schedule a script to be run in the background without showing powershell console window:

schtasks /create /tn myTask /tr "powershell -NoLogo -WindowStyle hidden -file myScript.ps1" /sc minute /mo 1 /ru System

/ru switch lets you change the user context in which the scheduled task will be executed.

answered 2013-06-22T08:51:58.447

Your Answer