Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTA IE& Beta 3 issue 1

Status
Not open for further replies.

bn2hunt

MIS
May 15, 2003
203
US
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.

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>&nbsp;
				</td>
				<td width = "3%" valign="top">&nbsp;</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&nbsp<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



 
I can't help you with the script, but I'd love to have a copy of it when it is working. Just what I need.

Are you using a cmethod to get the catalog?
 
I don't know if this will solve your problem but its worth looking into. Have you considered using setinterval

e.g Putting
iTimerID = window.setInterval("y", 1000, "VBScript")


in the onload event will run the function called y every 1 second

after setting global var cnt to 25 the procedure y could look something like

function y()
if stoploop = "no" then
Text1.innerHTML= "Time Left Before action : " & Cnt

cnt = cnt - 1
if cnt < 0 then
window.close
end if
end if
end function


Hope this gives you something to go on.

Cheers.
 
Taupirho , thank you I have been beating my head on my desk trying to figure out why the previous method works in IE7 but not IE6, your method works in both.

Rockett0, I am assuming you noticed that I am writing this to use with radia. I do not work with the radia servers so I do not know what the method we are using to pull the catalog is called. I know we are using command line commands to pull the information we need and that is has something to do with how we set up the jobs inside radia but other than that I am not able to asnwer your question.

As for posting the final script I will have to check with our radia team and my supervisor but they might let me post it. But I don't know.

Thanks agian Taupirho

Dan

bn2hunt

"Born to hunt forced to work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top