我有一个简单的问题,包括XP,PowerShell和计划任务。我有一个工作脚本,使用PowerShell 2.0和计划任务在Win7上,我想要的是在Windows XP 。我安装了必需的框架,并且脚本已经准备好在winxp上,但是我不能让计划任务工作。我给你安装了我在win7上使用的bat,以自动添加所需的计划任务,并期望学习如何安排它同样在winxp上。Powershell 2.0脚本作为XP上的计划任务
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"
基本上我需要同上面安装(WIN7)在Win XP的计划tasks.Powershell脚本位于在我的电脑下面的目录。
C:\ Documents和Settings \管理员\桌面\ PowerIdleV3 \ power_script.ps1提前
谢谢!
编辑: 我找到了解决方案:
1)添加自定义程序,选择 C:\窗口\ system32 \ WindowsPowerShell \ V1.0 \ powershell.exe
2)然后程序行改变至低于 C:\窗口\ system32 \ WindowsPowerShell \ V1.0 \ powershell.exe -nonInteractive -WindowStyle隐藏-ExecutionPolicy旁路-File C:\ PowerIdleV3 \ power_script.ps1
4多年以后,感谢您添加您的soluti上。 – khaverim