dim ArgObj,str,strtmp
Set ArgObj = WScript.Arguments
If ArgObj.Count 1 Then
strtmp=无参数操作!
else
select case ArgObj.Item(0)
case startup
strtmp= 服务器启动.
case shutdown
strtmp= 服务器关闭.
case else
strtmp= 未知操作!参数:+ArgObj.Item(0)
end select
end if
set fso=CreateObject(Scripting.FileSystemObject)
set tmp=fso.opentextfile(d:\log\logtime.txt,8,true)
str=[+cstr(now())+] +strtmp+chr(13)+chr(10)
tmp.write str
tmp.close
set tmp=nothing
set fso=nothing
=================================================
这个脚本有两个参数:startup和shutdown.当用作启动脚本时,使用startup参数;当用做关机脚本时,使用shutdown参数.另外,脚本中使用了FileSystemObject对象,使用该脚本前请确保这个对象已经存在于你的计算机上.
(2)按照前面的方法将脚本设置好.每次计算机启动或关机,这个脚本都会运行,并将计算机启动或关机的时间(实际上这个脚本运行时的时间,但两者应该相差无几)记录到一个文本文件中,例子中是d:\log\logtime.txt,可以根据需要更改.
2.删除一些特殊的共享