I have an HTA with a countdown timer built into it that works in IE6 but when I run it on a machine with IE3 Beta 3 the countdown timer doesn't update.
Does anybody know of a different way to have a countdown timer built into an hta that I can try to use with IE7. I would continue with the script but with IE7 in the not so distant future I'm not sure I want to hope that it is a problem with the beta that will be fixed with the current version.
Thanks
Dan
Code:
<html>
<head>
<title>EMC Laptop Software Updates</title>
<HTA:APPLICATION
ID="objRunomatic"
APPLICATIONNAME="EMC Laptop Software Updates"
SCROLL="no"
maximizebutton = "no"
minimizebutton = "no"
scroll = "no"
scrollflat = "no"
sysmenu = "yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
CONTEXTMENU="no"
Borderstyle="Complex"
ShowinTaskBar="no">
</head>
<style>
BODY
{
background-color: buttonface;
font-family: Helvetica;
font-size: 8pt;
margin-top: 10px;
margin-left: 20px;
margin-right: 20px;
margin-bottom: 10px;
}
.button
{
font-family: Helvetica;
font-size: 8pt;
width: 130px;
}
textarea
{
font-family: arial;
font-size: 8pt;
}
select
{
font-family: arial;
font-size: 8pt;
margin-left: 0px;
}
td
{
font-family: arial;
font-size: 10pt;
}
</style>
<SCRIPT LANGUAGE="VBScript.encode">
Set fs = CreateObject("Scripting.FileSystemObject")
Set WsNet = CreateObject("WScript.Network")
Set ws = CreateObject("WScript.Shell")
strcomputer = wsnet.computername
Const forreading = 1
Radskman1 = "c:\progra~1\novadigm\RADSKMAN.exe mname=GREATWHITE,dname=SOFTWARE,ip=172.22.15.50,port=3464,sname="
Radskman2 = ",uid=$machine,startdir=SYSTEM,ind=n,exec=y,cat=prompt,ulogon=n,context=m"
Dim arrCriticalApps()
CritCount = 0
ReDim preserve arrCriticalApps(critcount)
'*** variables read or written to registry
Dim deferdate,defertodate,daystodefer,newdaystodefer
Dim go
Dim arrNormalApps(300)
Dim NormCount
stoploop = "no"
Sub Window_Onload
window.resizeTo 600,370
window.moveto 10,10
countdowntimer(25)
End Sub
Function countdowntimer(cnt)
'/-> LOOP TO COUNT DOWN TO ZERO
Do
If stoploop = "no" Then
Cnt = Cnt - 1
'MsgBox "cnt: " & cnt
Text1.innerHTML= "Time Left Before action : " & Cnt
Rst1()
'MsgBox "returned from rst1"
Else
cnt=0
End If
Loop Until Cnt = 0
window.close
End Function
Function Rst1()
Dim Ts : Set Ts = Fs.OpenTextFile(SD & "\Rest1.vbs", 2, True)
Ts.WriteLine "Wscript.sleep 1000" : Ts.close
ws.run(SD & "\Rest1.vbs"), 1 ,True
'Fs.DeleteFile(SD & "\Rest1.vbs")
End Function
</SCRIPT>
<body>
<table width="100%">
<tr>
<td width = "50%" colspan=3>
<input id=runbutton class="button" type="button" value="Critical" name="crit" onClick="button1">
<input id=runbutton class="button" type="button" value="Mandatory" name="man" onClick="button2">
<input id=runbutton class="button" type="button" value="Updates" name="updte" onClick="button3">
</td>
</tr>
<tr>
<td width="25%" valign=top border>
<span id=radiatitle><b> Radia Software</b></span><BR><span id="updatesList"><select style="width:250" size="15" name="D1" multiple></select></span>
</td>
<td width = "3%" valign="top"> </td>
<td width = "18%">
<b>Options</b>
<table width="100%" border>
<tr>
<td>
<input type="radio" name="UserOption" value="3" checked>Install Critical<BR>
<input type="radio" name="UserOption" value="1">Install selected<BR>
<input type="radio" name="UserOption" value="2" onclick="deferal()">Defer Installation<BR>
Defer installation for <select size="1" style="width:75" name="DropDown1" onselect="RunScript" disabled=true>
</select>
</td>
</tr>
</table>
<br>
<input id=runbutton class="button" type="button" value="Ok" name="ok" onClick="button4">
</td>
</tr>
<Center><Table Class='Normal'><TD Class='Link1' WIDTH='350'>
<SPAN ID='Text1'></SPAN></TD></Table></Center><BR>
</table>
</body>
</html>
Does anybody know of a different way to have a countdown timer built into an hta that I can try to use with IE7. I would continue with the script but with IE7 in the not so distant future I'm not sure I want to hope that it is a problem with the beta that will be fixed with the current version.
Thanks
Dan