有没有办法将命令插入到 Windows 任务计划程序中?

Naf*_*Kay 3 windows command-line

我需要每天晚上 11 点在 Windows 机器上运行一个命令。为了简单起见,我想将此命令自动插入到 Windows 的事件调度程序中。我正在做这样的事情:

insertCommandIntoTaskScheduler.exe --at "11:00pm every night" "shutdown.exe -s -f"
Run Code Online (Sandbox Code Playgroud)

这是可能的,还是我必须使用 UI?

use*_*686 6

使用schtasks.

schtasks /create /tn "Shutdown" /tr "shutdown -s -f -t 0" /sc daily /st 23:00:00
Run Code Online (Sandbox Code Playgroud)