![](/img/trans.png)
[英]Task scheduler Windows Server 2019 - Task not running ONSTART
[英]Powershell Command in Windows Server 2019 Task Scheduler?
我正在尝试安排 Powershell 任务在 Windows 启动后自动启动(在发生崩溃或维护时重新启动进程)。 My knowledge of Powershell is very limited, but when I manually want to start the task, I need to go to the folder in Explorer, and open Powershell from there which defaults me to "PS C:\Users{{username}}\Documents \fso\fso> " 然后我在其中输入 "./watchdog.bat"。 在尝试设置任务计划程序时,它似乎正在寻找我不知道的 .ps1 文件。 有人介意帮我解决这个问题吗?
非常感谢提前:)
感谢 Mathias R。 杰森的帮助,
解决方案是在“添加参数”字段中添加要运行的命令或文件,放置-Command './watchdog.bat'
或 -File -File "C:\path\to\script.ps1"
,其中script.ps1
将是一个调用watchdog.bat
的 powershell 脚本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.