title: How to schedule a PowerShell script? The script works fine when run directly
body: <p>I have a powershell script which works fine when I run it manually. But I am facing issues while scheduling it. Every time the script opens as "notepad.exe" and it isn't executed with the error code 203 and then 103.</p>
  
  <p>The error I get is:</p>
  
  <p><code>Task Scheduler failed to launch action "C:\Windows\System32\notepad.exe" in instance "{afe7adf1-f132-4dd4-95fa-05a8d8374539}" of task "\Mytask". Additional Data: Error Value: 2147942667.</code></p>
  
  <p>Under action I have given the script path (in Program/Script after browsing).And in "Start in" I have given <code>powershell.exe -file D:\Myscript.ps1</code></p>
  
  <p>Please help.</p>