Save the following code as a VBS file, such as: Shutdown.vbs, then double-click or point to right on file
The key selection opens with a command prompt, and if you set the reboot, the system will have a shutdown dialog.
Box.
Directly below the code program will appear shutdown dialog box, the final return comment off, normal use
, please remove the annotation character.
The following code is passed under Window 2000.
Copy Code code as follows:
' Timed shutdown or restart script, passed under Windows 2000
' Code by Haiwa 2005-11-7
Dim ActionId
ActionId = 1 ' 0 logoff, 1 shutdown, 2 reboot,
Actiontime = "2005-11-7 13:42:30" ' Shutdown or restart time
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
' When using, please remove the following annotation characters
' Objshell.sendkeys (' {ENTER} ')
End Function
While True
If DateDiff ("s", now, Actiontime) < 0 Then
ShutDown ()
End If
Wscript.Sleep (5*1000)
Wend