簡體   English   中英

Windows Server 2019 任務計划程序中的 Powershell 命令?

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

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM