如何通过命令行启动Windows Scheduler?

发布于 2024-07-11 01:45:19 字数 1459 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

成熟的代价 2024-07-18 01:45:19

taskschd.msc 适用于 Windows Vista 及更高版本。

http://technet.microsoft.com/en-us/library/cc721871.aspx

我可以发誓我见过一个小任务调度程序 GUI,就像你之前所说的那样Vista,但也许我正在考虑“添加计划任务”向导。

您可能不得不使用此命令打开计划任务资源管理器:

control schedtasks

不幸的是,我找不到任何方法从命令行启动“添加计划任务”向导(必须有办法!)

taskschd.msc is available in Windows Vista and later.

http://technet.microsoft.com/en-us/library/cc721871.aspx

I could have sworn I'd seen a little task scheduler GUI like you're talking about prior to Vista, but maybe I was thinking of the "Add Scheduled Task" wizard.

You might have to settle for opening the scheduled tasks explorer with this command:

control schedtasks

I couldn't find any way to launch the "Add Scheduled Task" wizard from the command line, unfortunately (there has to be a way!)

浴红衣 2024-07-18 01:45:19

我在服务器上使用Windows 2003。 我正在使用“SCHTASKS.EXE”,

    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 /?

    ┌─────────────────────────────────────┐
    │ Executed Wed 02/29/2012 10:48:36.65 │
    └─────────────────────────────────────┘

它非常有趣,让我感觉非常强大。 :)

I'm using Windows 2003 on the server. I'm in action with "SCHTASKS.EXE"

    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 /?

    ┌─────────────────────────────────────┐
    │ Executed Wed 02/29/2012 10:48:36.65 │
    └─────────────────────────────────────┘

It's quite interesting and makes me feel so powerful. :)

很糊涂小朋友 2024-07-18 01:45:19

这将启动计划任务 MMC 控制面板:

%SystemRoot%\system32\taskschd.msc /s

旧版本的 Windows 具有 MMC 控制面板的启动屏幕,而 /s 开关将禁止它。 这不是必需的,但也没有什么坏处。

This launches the Scheduled Tasks MMC Control Panel:

%SystemRoot%\system32\taskschd.msc /s

Older versions of windows had a splash screen for the MMC control panel and the /s switch would supress it. It's not needed but doesn't hurt either.

左秋 2024-07-18 01:45:19

是的,GUI 在 XP 中可用。 例如,我可以使用以下命令获取要打开的计划任务列表(但不是 GUI),

control.exe  schedtasks

然后您可以使用向导添加新的计划任务。

在 XP 中,如果您搜索“计划任务”,然后单击“分步说明”并打开计划程序 GUI,则可以从 Windows 帮助中找到计划程序 GUI。 单击最后一个链接将执行以下命令,该命令可能会转换为从命令行打开 Scheduler GUI 的命令。 有人知道怎么做吗?

ms-its:C:\WINDOWS\Help\mstask.chm::/EXEC=,control.exe, schedtasks CHM=ntshared.chm FILE=alt_url_windows_component.htm

Yes, the GUI is available in XP. I can get the list of scheduled tasks (but not the GUI) to open with the following command,

control.exe  schedtasks

Then you can use the wizard to add a new scheduled task, for example.

In XP, you can find the Scheduler GUI from within Windows Help if you search for "Scheduled Tasks" then click on "Step by Step instructions" and open the scheduler GUI. Clicking on the last link executes the following command, which likely could be translatedinto something that would open the Scheduler GUI from the command line. Does anyone know how?

ms-its:C:\WINDOWS\Help\mstask.chm::/EXEC=,control.exe, schedtasks CHM=ntshared.chm FILE=alt_url_windows_component.htm
简单 2024-07-18 01:45:19

这是我刚刚使用的一个例子:

at 8am /EVERY:M,T,W,Th,F,S,Su cmd /c c:\myapp.exe

结果是:

Added a new job with job ID = 1

然后,检查我的工作:

at

Here is an example I just used:

at 8am /EVERY:M,T,W,Th,F,S,Su cmd /c c:\myapp.exe

The result was:

Added a new job with job ID = 1

Then, to check my work:

at
几度春秋 2024-07-18 01:45:19

您可以创建一个新的快捷方式:

control schedtasks

将其命名为简单的名称,例如“tsks.lnk”,然后将其保存在 c:\windows\system32 中。

现在,您可以按 Windows 键 + R,然后输入“tsks”并按 Enter 瞧。 此时不需要鼠标。
或者在 Windows Vista/7/2008 中,只需按 Windows 键,然后输入“tsks”并按 Enter

You can make a new shortcut to:

control schedtasks

Name it something easy like "tsks.lnk" and then save it in c:\windows\system32.

You can now press Windows Key + R, then type "tsks" and press Enter and voila. No mouse necessary at that point.
Or in Windows Vista/7/2008, just press Windows Key, then type "tsks" and press Enter.

懵少女 2024-07-18 01:45:19

您可能想看看简单的命令行调度程序“at”:


C:\Documents and Settings\mahendra.patil>at/?

AT 命令调度命令和程序在计算机上运行
指定的时间和日期。 计划服务必须正在运行才能使用
AT 命令。

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
    [ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\computername 指定远程计算机。 命令安排在
如果省略此参数,则为本地计算机。

id 是分配给预定的标识号
命令。

/delete 取消计划的命令。 如果省略 id,则所有
计算机上预定的命令被取消。

/yes 与取消所有作业命令一起使用(当不再需要时)
需要确认。

time 指定命令运行的时间。

/interactive 允许作业与用户桌面交互
作业运行时谁登录。

/every:date[,...] 在一周中的每个指定日期运行命令或
月。 如果省略日期,则为当月的当前日期
假设。

/next:date[,...] 在下一次出现该日期时运行指定的命令
日(例如,下周四)。 如果省略日期,则
假设是当月的当前日期。

“command” 是 Windows NT 命令或要运行的批处理程序。

You might want to have look at simple command line scheduler "at":


C:\Documents and Settings\mahendra.patil>at/?

The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
    [ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\computername Specifies a remote computer. Commands are scheduled on the
local computer if this parameter is omitted.

id Is an identification number assigned to a scheduled
command.

/delete Cancels a scheduled command. If id is omitted, all the
scheduled commands on the computer are canceled.

/yes Used with cancel all jobs command when no further
confirmation is desired.

time Specifies the time when command is to run.

/interactive Allows the job to interact with the desktop of the user
who is logged on at the time the job runs.

/every:date[,...] Runs the command on each specified day(s) of the week or
month. If date is omitted, the current day of the month
is assumed.

/next:date[,...] Runs the specified command on the next occurrence of the
day (for example, next Thursday). If date is omitted, the
current day of the month is assumed.

"command" Is the Windows NT command, or batch program to be run.

_蜘蛛 2024-07-18 01:45:19

您可以使用 TASKSCHD.MSCCONTROL SCHEDTASKS

这里还有一些这样的命令。

You can use either TASKSCHD.MSC or CONTROL SCHEDTASKS

Here are some more such commands.

断肠人 2024-07-18 01:45:19

我也在运行 XP SP2,并且这完美地工作(从命令行...):

start control schedtasks

I'm also running XP SP2, and this works perfectly (from the command line...):

start control schedtasks
满身野味 2024-07-18 01:45:19

如果您问我认为您在问什么,您可以通过执行以下命令打开它:

explorer.exe "C:\WINDOWS\Tasks\"

If you’re asking what I think you’re asking, you can open it by executing this:

explorer.exe "C:\WINDOWS\Tasks\"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文