Re: Count down timer by ItsMillerTime4u
ItsMillerTime4u
Mon Jun 18 16:11:16 CDT 2007
The only other way to do this is to instead of a MsgBox, use an HTA
that has its inner text change as it counts down. Usually you would
have the main text, and then have a div for the number field, and then
as you count down you just dynamically change the number in the div
until 0 is met. I have some example code if need it See below:
<HTML>
<HEAD>
<TITLE>TIMER</TITLE>
<SCRIPT LANGUAGE="VBSCRIPT">
maxTime = 10
Sub Window_OnLoad()
x=1
For a = (objTable.Rows.Length -1) to 0 Step -1
myNewRow = document.all.objTable.deleteRow(a)
Next
Set objRow = objTableBody.InsertRow()
objRow.Style.fontSize = "12px"
Set objCell = objRow.InsertCell()
timeLeft = maxTime - x
If timeLeft = 0 Then Reboot()
objCell.InnerText = TimeLeft
x=x+1
Sleep(1)
Loop
End Sub
Function Sleep(x)
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "%COMPSPEC% /c ping -n " & 1+x & " 127.0.0.1>nul", 0, 1
End Function
</SCRIPT>
</HEAD>
<BODY>
Countdown Timer:
<CENTER>
<TABLE ID="objTable" border="0" bgcolor="ThreeDHighlight">
<TBODY ID="objTableBody"></TBODY>
</TABLE>
</CENTER>
</BODY>
</HTML>