2008自动关机、休眠的免费小软件

XP方法:

添加定时任务

  如果你想出门,但电脑又正在进行工作,这时就要用到自动关机。大多数实现自动关机的方法都是使用一些第三方软件,这样不仅麻烦,而且为实现这个小功能而专门动用一个软件,显的小题大做了!其实Windows XP(Windows 2000也可以)自身就具备定时关机的功能,下面我们就来看看如何实现Windows XP的自动关机。

  Windows XP的关机是由Shutdown.exe程序来控制的,位于Windows\System32文件夹中。如果想让Windows 2000也实现同样的效果,可以把Shutdown.exe复制到系统目录下。

  比如你的电脑要在22:00关机,可以选择“开始→运行”,输入“at 22:00 Shutdown -s”,这样,到了22点电脑就会出现“系统关机”对话框,默认有30秒钟的倒计时并提示你保存工作。如果你想以倒计时的方式关机,可以输入“Shutdown.exe -s -t 3600”,这里表示60分钟后自动关机,“3600”代表60分钟。

  设置好自动关机后,如果想取消的话,可以在运行中输入“shutdown -a”。另外输入“shutdown -i”,则可以打开设置自动关机对话框,对自动关机进行设置。

  Shutdown.exe的参数,每个都具有特定的用途,执行每一个都会产生不同的效果,比如“-s”就表示关闭本地计算机,“-a”表示取消关机操作,下面列出了更多参数,大家可以在Shutdown.exe中按需使用。

  -f:强行关闭应用程序

  -m\\计算机名:控制远程计算机

  -i:显示图形用户界面,但必须是Shutdown的第一个选项

  -l:注销当前用户

  -r:关机并重启

  -t时间:设置关机倒计时

  -c “消息内容”:输入关机对话框中的消息内容(不能超127个字符)

  要想定时关机或重启,可以把它做成BAT文件,然后再用计划任务执行。如:

  定时关机

  at 10:00 shutdown -f

  存为“关机.bat”新建一个计划任务,程序指向这个BAT文件,下一步步,完成,就OK了。

  自动登录

  第1步:运行注册表编辑器,依次展开[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon ]分支,然后在右侧窗口双击“DefaultUserName”,接着输入你的登录用户名。如果没有预设的用户名称,可以在注册表编辑器的菜单栏点选“编辑→新建→字符串值(s)→DefaultUserName”来添加这个项目,注意要区分大小写字母。

  第2步:同样在该分支下,在注册表编辑器的右侧窗口中双击“DefaultPassword”,然后在空白栏内输入你的密码。假如未发现“DefaultPassword”一项,可按上面的步骤来新建该字符串值。

  第3步:接下来在右侧窗口中双击“AutoAdminLogon”,将数值设置为“1”。假如未发现“AutoAdminLogon”,可按上面的步骤来新建。

 

 

 

 

 

最近我将本本上的系统由2003升级到了2008,发现原先我用来自动关机、休眠的免费小软件 poweroff 无法使用了(不起作用)。也懒得找了,就用系统自带的指令实现吧。

首先想到的当然是 shutdown 指令, 但是它有一个致命缺陷: 无法实现定时休眠

没办法, google 了下, 原来 SysinternalsSuite 工具包中就有一个能实现定时休眠的工具: psshutdown

试用了下,效果俱佳,完全能满足我的需要。 注意下面的 -v 参数

常用指令如下:
半小时候自动休眠: psshutdown -h -t 1800 -v 0


注意:
-v 参数后接一个数字, 表示出现提示信息的时间,设置为0,表示不出现提示信息。
必须指定 -v 参数, 否则会出现 "A program can't display a message on your desktop." 错误信息:

 

 


完整使用说明:
------------------------------------------------------------------------------------------------
usage:
psshutdown -s|-r|-h|-d|-k|-a|-l|-o [-f] [-c] [-t [nn|h:m]] [-v nn] [-e [u|p]:xx:yy] [-m "message"] [-u Username [-p password]] [-n s] [\\computer[,computer[,...]|@file]
   -a          Abort a shutdown (only possible while countdown is in progress)
   -c          Allow the shutdown to be aborted by the interactive user
   -d          Suspend the computer
   -e          Shutdown reason code (available on Windows XP and higher).
               Specify 'u' for unplanned and 'p' for planned
               shutdown reason codes.
               xx is the major reason code (must be less than 256)
               yy is the minor reason code (must be less than 65536)
   -f          Forces running applications to close
   -h          Hibernate the computer
   -k          Poweroff the computer (reboot if poweroff is not supported)
   -l          Lock the computer
   -m          Message to display to logged on users
   -n          Specifies timeout in seconds connecting to remote computers
   -o          Logoff the console user
   -p          Specifies optional password for user name. If you omit this
               you will be prompted to enter a hidden password.
   -r          Reboot after shutdown
   -s          Shutdown without poweroff
   -t          Specifies countdown in seconds until shutdown (default is 20) or
               the time of shutdown (in 24 hour notation)
   -u          Specifies optional user name for login to remote
               computer.
   -v          Display message for the specified number of seconds before
               the shutdown. If you omit this parameter the shutdown
               notification dialog displays and specifying a value of 0
               omits the dialog.
   computer    Shutdown the computer or computers specified
   @file       Shutdown the computers listed in the file specified


Reasons defined on this computer (U = unplanned, P = planned):
Type   Major   Minor   Title
U      0       0     Other (Unplanned)
P      0       0     Other (Planned)
U      1       1     Hardware: Maintenance (Unplanned)
P      1       1     Hardware: Maintenance (Planned)
U      1       2     Hardware: Installation (Unplanned)
P      1       2     Hardware: Installation (Planned)
P      2       3     Operating System: Upgrade (Planned)
U      2       4     Operating System: Reconfiguration (Unplanned)
P      2       4     Operating System: Reconfiguration (Planned)
P      2      16     Operating System: Service pack (Planned)
U      2      17     Operating System: Hot fix (Unplanned)
P      2      17     Operating System: Hot fix (Planned)
U      2      18     Operating System: Security fix (Unplanned)
P      2      18     Operating System: Security fix (Planned)
U      4       1     Application: Maintenance (Unplanned)
P      4       1     Application: Maintenance (Planned)
P      4       2     Application: Installation (Planned)
U      4       5     Application: Unresponsive
U      4       6     Application: Unstable
U      5      19     Security issue
P      5      19     Security issue
U      5      20     Loss of network connectivity (Unplanned)
P      7       0     Legacy API shutdown

 


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值