gpt4 book ai didi

windows - 如何以编程方式停止/启动远程计算机上的计划任务?

转载 作者:可可西里 更新时间:2023-11-01 11:57:58 26 4
gpt4 key购买 nike

我想编写一个脚本来停止远程计算机上的计划任务,执行一些操作,然后重新启动计划任务。

我该怎么做?

最佳答案

这是我发现的。

停止:

schtasks /end /s <machine name> /tn <task name>

开始:

schtasks /run /s <machine name> /tn <task name>


C:\>schtasks /?

SCHTASKS /parameter [arguments]

Description:
Enables an administrator to create, delete, query, change, run and
end scheduled tasks on a local or remote system. Replaces AT.exe.

Parameter List:
/Create Creates a new scheduled task.

/Delete Deletes the scheduled task(s).

/Query Displays all scheduled tasks.

/Change Changes the properties of scheduled task.

/Run Runs the scheduled task immediately.

/End Stops the currently running scheduled task.

/? Displays this help message.

Examples:
SCHTASKS
SCHTASKS /?
SCHTASKS /Run /?
SCHTASKS /End /?
SCHTASKS /Create /?
SCHTASKS /Delete /?
SCHTASKS /Query /?
SCHTASKS /Change /?

关于windows - 如何以编程方式停止/启动远程计算机上的计划任务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/290559/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com