title: Powershell 2.0 script as scheduled task on XP
body: <p>i have a simple problem including xp,powershell and scheduled tasks.I have a working script that uses powershell 2.0 and scheduled tasks on win7,all i want is to do the same on windows xp.I installed required frameworks and the script is ready on winxp,but i just couldnt make the scheduled task work.I am giving you the installion bat i used on win7 to automativly add the required scheduled task,and expecting to learn how to schedule it same on winxp.</p>
  
  <pre><code>schtasks /delete /tn "PowerIdle" /F  
  schtasks /delete /tn "PowerIdleKill" /F  
  schtasks /delete /tn "PowerIdleSleep" /F  
  schtasks /create /tn "PowerIdle" /tr "powershell -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -File \"%~dp0power_script.ps1\"" /sc minute /mo 30 /st 00:00  
  schtasks /run /tn "PowerIdle"
  </code></pre>
  
  <p>Basically i need the same install above (win7) in win xp scheduled tasks.Powershell script is located in the directory below in my computer.</p>
  
  <p>C:\Documents and Settings\Administrator\Desktop\PowerIdleV3\power_script.ps1</p>
  
  <p>Thanks in advance!</p>
  
  <p>Edit:
  I found a solution:</p>
  
  <p>1) Add a custom program, select
  <strong>C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe</strong></p>
  
  <p>2) then change the program line to below
  <strong>C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -File C:\PowerIdleV3\power_script.ps1</strong></p>