Windows任务调度程序的问题,在Windows 2008服务器中运行PowerShell脚本

时间:2013-02-26 10:48:32

标签: batch-file powershell scheduled-tasks batch-processing powershell-v1.0

这个问题似乎是一个非常常见的问题,但我已经为解决方案做了所有可能的事情,但对我来说没有任何作用。 我试图通过批量powershell.exe c:\ Powershell \ process.ps1运行powershell脚本 process.ps1 - 我的powershell脚本存在的位置。 我遇到了一个奇怪的问题,当我在Windows任务调度程序中安排任务时,它显示操作已成功完成但是当我检查结果时,没什么好开心的。 “剧本根本没有运行”

当我手动双击批处理时,脚本运行得非常好。我的问题是,当脚本手动批量运行时,可能是没有在任务调度程序中运行的原因。从技术上讲......脚本在cmd.exe中运行但没有按计划运行(Windows任务调度程序2008服务器)。

我尝试检查Windows任务调度程序中的每个选项,我从多年开始运行任务调度程序。我完全空白了解进一步的故障排除步骤。请帮忙

1 个答案:

答案 0 :(得分:3)

这有用吗? 创建计划任务以运行PowerShell脚本
http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/11/weekend-scripter-use-the-windows-task-scheduler-to-run-a-windows-powershell-script.aspx

总结:在“启动程序”窗格的“程序/脚本”框中 powershell -file "path\and\script\filename.ps1"