Timer Shutdown Applet
Interface:
Implementation code:
Copy Code code as follows:
<title> Timing Shutdown Applet </title>
Applicationname= "HTA Test"
Borde= "Thin"
Borderstyle= "Raised"
icon= "C:\WINDOWS\SYSTEM32\control.exe"
Scroll= "No"
Singleinstance= "Yes"
Maximizebutton= "No"
Minimizebutton= "No"
Windowstate= "Normal"
>
<script language= "VBScript" >
Sub Window_onload
StrComputer = "."
Set objWMIService = GetObject ("winmgmts:\\" & StrComputer & "\root\cimv2")
Set colitems = objWMIService.ExecQuery ("SELECT * from Win32_DesktopMonitor")
For each objitem in colitems
Inthorizontal = Objitem.screenwidth
Intvertical = Objitem.screenheight
Next
Intleft = (intHorizontal-240)/2
Inttop = (intVertical-500)/2
Window.resizeto 240,500
Window.moveto Intleft, Inttop
End Sub
Sub onesub
Set Objectshell=createobject ("Wscript.Shell")
Ireturn = Objectshell.run ("shutdown-s-f-t 1800", 0, TRUE)
End Sub
Sub twosub
Set Objectshell=createobject ("Wscript.Shell")
Ireturn = Objectshell.run ("Shutdown-s-f-t 2700", 0, TRUE)
End Sub
Sub thrsub
Set Objectshell=createobject ("Wscript.Shell")
Ireturn = Objectshell.run ("Shutdown-s-f-t 3600", 0, TRUE)
End Sub
Sub OK
If IsNumeric (Text.value) Then
Overtime = Text.value * 60
Set Objectshell=createobject ("Wscript.Shell")
Ireturn = Objectshell.run ("Shutdown-s-f-t" & overtime, 0, TRUE)
Else
MsgBox "Please enter a valid number. "
End If
End Sub
Sub ShutDown
Set Objectshell=createobject ("Wscript.Shell")
Ireturn = Objectshell.run ("shutdown-s-T 0", 0, TRUE)
End Sub
Sub Eshutdown
Set Objectshell=createobject ("Wscript.Shell")
Ireturn = Objectshell.run ("Shutdown-a", 0, TRUE)
End Sub
</script>
<body>
<br>
<center><div><input type= "button" style= "height:30px;line-height:20px;border:1px solid #aaa;" value= "Turn off computer after 30 minutes" name= "Run_button" onclick= "Onesub" ><p> </div></center>
<center><div><input type= "button" style= "height:30px;line-height:20px;border:1px solid #aaa;" value= "Turn off computer after 45 minutes" name= "Run_button" onclick= "Twosub" ><p> </div></center>
<center><div><input type= "button" style= "height:30px;line-height:20px;border:1px solid #aaa;" value= "Turn off computer after 60 Minutes" name= "Run_button" onclick= "Thrsub" ><p> </div></center>
<br>
Custom Time (minutes):<p>
<input type= "text" name= "text" id= "text" style= "height:23px;width:120px;line-height:20px;border:1px solid #aaa;" />
<input name= "Submit" type= "submit" style= width:50px;height:23px;line-height:20px;border:1px solid #aaa; "Value=" OK "onclick=" OK ><p>
<br>
<center><div><input type= "button" style= "height:30px;line-height:20px;border:1px solid #aaa;" value= "Cancel scheduled Logoff" Name= "Run_button" onclick= "Eshutdown" ><p> </div></center>
<center><div><input type= "button" style= "height:30px;line-height:20px;border:1px solid #aaa;" value= "Turn Off Computer" name= "Run_button" onclick= "ShutDown" ><p> </div></center>
<br>
<center><div><a href= "http://www.enun.net/" >http://www.enun.net/</a></div></ Center>
</body>
Packaged Downloads: Dsgj_jb51.rar