schtasks命令使用实例介绍

Admin | 2010-6-13 17:14:49 | TrackRecord: 2387 Times | Tag标签:计算机网络技术 打印本页

您当前所处的位置是:〖首页〗→【文章页】 本站共有16个图文教程栏目,请用心拜读!

本站提供经典的Excel公式函数实例,Word排版技巧,PPT教程;同时更兼有Flash,PowerPoint,数据库等技术文章。

  schtasks命令,用途广泛,使用高效,不仅能为本地计算机添加任务计划,而且还能通过某台计算机的操作,运行另外一台计算机的程序。可定时、定日、定月、定周、定年等让本机或局域网电脑启动软件。

  下面,是schtasks命令的常用的实例介绍,希望对您有所帮助。

  一、schtasks命令的相关属性查询方法

  查看计划任务
  schtasks
  schtasks /query

  视图模式详细信息
  schtasks /query /v
  schtasks /query /v /fo list

  逗号分隔列表
  schtasks /query /v /fo csv

  逗号分隔列表,不显示标题
  schtasks /query /v /fo csv /nh
  schtasks /query /v /fo /nh
  schtasks /query /v /fo csv /nh
  C:\>schtasks /query /s 169.254.100.225 /u administrator /p windows
  INFO: There are no scheduled tasks present in the system.

  二、schtasks命令定时运行程序的实例介绍

  每24小时
  schtasks /create /tn Mytask /tr notepad.exe /sc hourly /ru zly /rp windows

  指定每12小时
  schtasks /create /tn mytask /tr notepad.exe /sc hourly /ru zly /rp windows /mo 12
  schtasks /create /tn mytask /tr write.exe /sc hourly /ru zly /rp windows /mo 23 /sd 2008/09/09 /ed 2009/09/09 /st 20:00:00
  C:\>schtasks /create /tn Mytask /tr notepad.exe /sc hourly /mo 12 /st 08:00:00 /
  sd 2007/07/07 /ed 2007/08/09 /ru zly /rp windows
  SUCCESS: The scheduled task "Mytask" has successfully been created.
  C:\>schtasks /delete /tn Mytask /f
  SUCCESS: The scheduled task "Mytask" was successfully deleted.

  每30天
  C:\>schtasks /create /tn Mytask /tr mmc.exe /sc daily /mo 30 /sd 2007/02/28 /ed
  2007/12/31 /st 20:00:00 /ru zly /rp windows

  每30个周
  C:\>schtasks /create /s 169.254.100.225 /u administrator /p windows /tn RemoteTe
  st /tr notepad.exe /sc weekly /mo 30 /ru administrator /rp windows
  SUCCESS: The scheduled task "RemoteTest" has successfully been created.

  每50个周
  C:\>schtasks /create /tn Mytask /tr "%systemdrive%\internet explorer\iexplore.ex
  e" /sc weekly /mo 50 /sd 2007/08/09 /ed 2007/08/10 /ru zly /rp windows

  任务在指定的日期和时间运行一次
  C:\>schtasks /create /tn Mytask /tr notepad.exe /sc once /st 20:00:00 /sd 2007/9/09 /ru zly /rp windows

  任务在每次系统启动的时候
  C:\>schtasks /create /tn Mytask /tr notepad.exe /sc onstart /ru zly /rp windows

  每当用户(任意用户)登录的时候
  C:\>schtasks /create /tn Mytask /tr notepad.exe /sc onlogon /ru zly /rp windows

  在空闲的10分钟时候运行一个屏保称序。
  C:\>schtasks /create /tn Mytask /tr "%windir%\system32\logon.scr /s" /sc onidle /i 10 /ru zly /rp windows
  把上面的scheduled---改变一个任务的称序和账户(administrator)
  C:\>schtasks /change /tn Mytask /tr write.exe /ru administrator /rp xxxxxx

  改变一个任务称序和账户(system)注意受限账户既便更改到system账户任务也无法运行,请参阅组策略-用户的权利分配。只有administrators组(默认)
  C:\schtasks /change /tn Mytask /tr write.exe /ru system

  运行一个任务
  C:\schtasks /run /tn Mytask

  结束一个任务
  C:\schtasks /end /tn Mytask

  删除全部的任务
  C:\schtasks /delete /tn * /f

  立即运行和终止远程计划任务
  C:\>schtasks /run /s 169.254.100.225 /u administrator /p windows /tn remotetest
  SUCCESS: Attempted to run the scheduled task "remotetest".

  C:\>schtasks /end /s 169.254.100.225 /u administrator /p windows /tn remotetest
  SUCCESS: The scheduled task "remotetest" has been terminated successfully.

  忘了空密码默认无法运行计划任务,想空密码运行计划任务,gpedit.msc-本地策略-安全设置-使用空白密码的本地帐户只允许进行控制台登录禁用。启用禁用如果不设密码可能会带来安全隐患。



上一篇:2010年5月云南省某校信息技术水平考    下一篇:更换网卡插槽后不能设置IP的解决办法

会员评论列表:
针对本篇文章或本站,请您发表个人的建议或批评!
FreeBoxPc

谷歌搜索 百度搜索 本站仅与内容具备一定的实用价值的原创网站交换友情链接,力争为大众做出更优质的服务!
All Rights Reserved版权所有 本站备案信息:滇ICP备11001339号-2 站长联系方式 Email:dzwebs@126.com