Issue with windows task scheduler with running a powershell script in windows 2008 server

user1926332 picture user1926332 · Feb 26, 2013 · Viewed 8.7k times · Source

This question would seem a very common question but i have done every possible thing for the solution but nothing works for me. I m trying to run a powershell script via batch powershell.exe c:\Powershell\process.ps1 process.ps1 - where my powershell script is present. I have encountered a strange problem, when i schedule the task in the windows task scheduler, it shows the operations has completed successfully but but when i check the results, Nothing happned. "The script did not run at all"

when i manually double click the batch, the script is running absolutely fine. My question is, when the script is running fine in batch manually, what could be the reasons of not running in task scheduler. Technically saying...the script is running in cmd.exe but not running on schedule (windows task scheduler 2008 server).

I tried checking each and every option in windows task scheduler, I operate task scheduler since ages. I am completely blank to understand the further troubleshooting steps. pls help

Answer

AjV Jsy picture AjV Jsy · Feb 26, 2013

Is this any use? Creating a Scheduled task to run a PowerShell script
http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/11/weekend-scripter-use-the-windows-task-scheduler-to-run-a-windows-powershell-script.aspx

In summary : in the Start a Program pane's Program/script box
powershell -file "path\and\script\filename.ps1"