How do i create a msgbox popup in the middle of my screen that displays an
active count down

for example "this pc will shutdown in 10 9 8 7 etc"
I have figured out the shutdown portion of this script, just can seem to
figure out the timer.

Thanks

Re: Count down timer by S

S
Mon Jun 18 15:14:03 CDT 2007

the "shutdown" command already does this if you pass it the number of
seconds to wait



"Byron" <startecXXXX@shaw.ca> wrote in message
news:%23naVnmdsHHA.1416@TK2MSFTNGP06.phx.gbl...
> How do i create a msgbox popup in the middle of my screen that displays an
> active count down
>
> for example "this pc will shutdown in 10 9 8 7 etc"
> I have figured out the shutdown portion of this script, just can seem to
> figure out the timer.
>
> Thanks


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>