[英]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.