Sprinkler Systems Uhaul move Lawn care Roses and trees Ford Parts Chrysler Parts Lake Powell New IPod Touch Apps New IPhone Apps IPhone Apps IPad Information IPad Apps Android APPS Android Games APPS Android Systems Android Tablets APPS and Beyond Smartphone Apps Smartphone Games Apps Repair and Tools Tablet PC Car Sharing Car Leasing Tabler Pc Fly Fishing Toyota Cars Vacation Rentals Stock market NYSE SSE Stock Freight & Shipping News Gluten Lactose Gout My Coupon Life Campgrounds Check Outdoor Kitchen Design and Redoo Bath Remodeling Palm Springs Las Vegas Vacation Tipps Lake Powell Boating Homes for lease Electric and green Car Blog Pearls and diamonds Whatsapp and forget SMS Blog, What is Whatsapp App Renovation Blog Condo for rent or lease Solar Panel Solar Energie Sun Power Blog Truck for Sale Reconstruction Blog
Computers » microsoft.public.cn.windows2000 » 总结:实现windows 2000 server定时
总结:实现windows 2000 server定时 [message #176442] Fr, 17 Mrz 2006 03:06
siaozhe  
一台旧配件拼凑的win2k
server用来提供几个静态web页面,下班以后就没 人访问了;由于该服务器没有其他用途,所以 很少有人登录;想实现在没有登录系统的情况 下定时自动关机同时关闭电源(节约能源);

因为要在没人登录的情况下实现,就这一条就 使那些成百上千的有着花里胡哨的界面和功能 的关机软件没有用了,估计要做成系统服务才 可以;也许也有部分软件可以实现,但是一般 要收费,另外还有占用系统资源的问题,万一 再遇上个代码不过关的,系统因此不稳定就顾 此失彼了。

经测试该server可以在正常关机时自动关闭电源 ,ACPI配置也没有问题;另外测试了以下2种情 :
1、用xp系统的shutdown.exe作任务计划关机时,出 现“你现在可以安全的关机了”提示但不自动 关闭电源;
2、用vbs的sendkeys和application.shutdownwindows()写了 机脚本但是也不能在系统注销(未登录)时 使用;参考关机脚本如下,将*内的内容用记 事本保存为vbs文件双击执行或者加入任务计划 ;
************************************************************ *******************
dim actionid
actionid = 1 '0注销,1关机,2重启,

function shutdown()
dim objshell
set objshell = wscript.createobject("wscript.shell")

dim application
set application = createobject("shell.application.1")
application.shutdownwindows()
dim upi
for upi = 0 to 4
wscript.sleep(50)
objshell.sendkeys("{up}")
next
for upi = 1 to actionid
wscript.sleep(50)
objshell.sendkeys("{down}")
next
objshell.sendkeys("{enter}")
end function

while true
shutdown()
wscript.sleep(5*1000)
wend
************************************************************ *******************

经过查找,终于发现了PsTools中的Psshutdown.exe可 以代替shutdown实现计划关机和关闭电源,有关P sTools的功能介绍和下载请到http://www.sysinternals. com/Utilities/PsTools.html查看,国内也有很多介绍 这里有psshutdown的详细用法:

usage: psshutdown [\\computer[,computer[,...] | [at] file [-u username [-p
password]]] -s|-r|-h|-d|-k|-a|-l|-o [-f] [-c] [-n s] [-t nn|h:m] [-e
[u|p]:xx:yy] [-m "message"]
computer
Run the command on the computer or computers specified. If you omit the
computer name the command runs on the local system and if you enter a
computer name of \\* then the command runs on all computers in the current
domain.
[at] file
Execute the command on each of the computers listed in the file.
-u
Specifies optional user name for login to remote computer
-p
Specifies optional password for user name. If you omit this you will be
prompted to enter a hidden password.
-a
Aborts a shutdown (only possible while a countdown is in progress)
-c
Allow the shutdown to be aborted by the interactive user
-e
Shutdown reason code. Specify 'u' for user reason codes 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 all running applications to exit during the shutdown instead of
giving them a chance to gracefully save their data
-h
Hibernate the computer
-k
Poweroff the computer (reboot if poweroff is not supported
-l
Lock the computer
-m
This option lets you specify a message to display to logged-on users when a
shutdown countdown commences
-n
Specifies timeout in seconds connecting to remote computers
-o
Logoff the console user
-r
Reboot after shutdown
-s
Shutdown without poweroff
-t
Specifies the countdown in seconds until the shutdown (default: 20 seconds)
or the time of shutdown in 24 hour notation
-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.

psshutdown.exe是一个控制台命令,可以加入到批 理文件中,比如我建立的批处理文件内容为 "psshutdown -f -k"
(引号内的内容),将该批处理文件计划运行 实现了无人登录系统情况下的完全关机。


那位大虾有更好的办法请多多指教。

和我交流:
msn:siaozhe [at] hotmail.com
email:siaozhe [at] 163.com
--
我爱Windows和Sql Server;
让我们翱翔在技术的天空!
Vorheriges Thema:λϸWIN2Kʹѻļ
Nächstes Thema:不知道什么原因,桌面上的WORD需
Gehe zu:
  


aktuelle Zeit: Sa Mai 26 03:47:10 CEST 2012

Insgesamt benötigte Zeit, um die Seite zu erzeugen: 0,04633 Sekunden
.:: Startseite - Hinweise - Impressum ::.

Powered