Networknet.nl Blog
Stay Connected
Stay Connected
The following steps will create a new scheduled task with defined schedule and execute a powershell script from a cmd file. To execute a ps1 script from command shell the ExecutionPolicy will need to be changed. To change the PowerShell Execution Policy open Windows PowerShell and run:
The new policy will allow system to execute Powershell scripts that are created locally.
Open Notepad and paste the text below with the name of the ps1 script. Save the file with cmd extension.
Start Windows Explorer / Go to Control Panel / Scheduled Tasks. Create new tasks and locate the cmd file. Fill out all required options like user account, schedule and Start In.
Example: