I have the following HTA code which includes a VBScript that runs an animated gif to show that a backup operation is in process. I already run the vbscript with the animated gif succesfully but when I try to use HTA to add a better GUI everything runs fine except when the backup copy begins. I have had to create a 5 second time just to see the new display with the gif. The animated gif works for 5 seconds and then freezes up while the copy occurs. Once the copy finishes the success window appears and the script ends. Can anyone shed light and why and how to handle this within an HTA window?
<SCRIPT LANGUAGE="VBScript">
Sub Window_onLoad
window.resizeTo 350,200
End Sub
</SCRIPT>
<BODY>
</BODY>
<html>
<head>
<title>Network Backup</title>
<HTA:APPLICATION
ID="netbackup"
APPLICATIONNAME="Network Backup"
ICON = "disk.ico"
SINGLEINSTANCE="yes"
WINDOWSTATE="Normal"
SCROLL = "no"
>
</head>
<script Language="VBScript">
intButtonCount = 1
Sub RunYes
document.body.InnerHTML = "<center><p><b>**Backup in Progress**<p><img border=""0"" alt="""" src=""timer.gif""><p>Please wait ..."
Dim dtmStartTime
dtmStartTime = Now
idTimer = window.setTimeout("runscript", 5000, "VBScript")
End Sub
Sub runscript
' Network Drive Conditional Folder Creation
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("Wscript.Network")
strUserName = objNetwork.UserName
FSO.CopyFolder "c:\My Documents", "\\servername\filename"
'Clean-Up and Completion Message
document.body.InnerHTML = ""
document.body.InnerHTML = "<center><p><b>** Backup Completed Successfully! **<p><img border=""0"" alt="""" src=""check.gif"">"
End Sub
Sub RunNo
End Sub
</script>
<body>
<center>
<font color="black" face="Times New Roman" size="3"> <b>Do You Want to Start a Network Backup?</font>
<p>
<input id=runbutton class="button" type="button" value="Yes" name="clear" onClick="RunYes">
<input id=runbutton class="button" type="button" value="No" name="No" onClick="RunNo">
<p>
<font color="red" face="Times New Roman" size="3"> <b>** Remember to Close Outlook **</font>
</body>
<SCRIPT LANGUAGE="VBScript">
Sub Window_onLoad
window.resizeTo 350,200
End Sub
</SCRIPT>
<BODY>
</BODY>
<html>
<head>
<title>Network Backup</title>
<HTA:APPLICATION
ID="netbackup"
APPLICATIONNAME="Network Backup"
ICON = "disk.ico"
SINGLEINSTANCE="yes"
WINDOWSTATE="Normal"
SCROLL = "no"
>
</head>
<script Language="VBScript">
intButtonCount = 1
Sub RunYes
document.body.InnerHTML = "<center><p><b>**Backup in Progress**<p><img border=""0"" alt="""" src=""timer.gif""><p>Please wait ..."
Dim dtmStartTime
dtmStartTime = Now
idTimer = window.setTimeout("runscript", 5000, "VBScript")
End Sub
Sub runscript
' Network Drive Conditional Folder Creation
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("Wscript.Network")
strUserName = objNetwork.UserName
FSO.CopyFolder "c:\My Documents", "\\servername\filename"
'Clean-Up and Completion Message
document.body.InnerHTML = ""
document.body.InnerHTML = "<center><p><b>** Backup Completed Successfully! **<p><img border=""0"" alt="""" src=""check.gif"">"
End Sub
Sub RunNo
End Sub
</script>
<body>
<center>
<font color="black" face="Times New Roman" size="3"> <b>Do You Want to Start a Network Backup?</font>
<p>
<input id=runbutton class="button" type="button" value="Yes" name="clear" onClick="RunYes">
<input id=runbutton class="button" type="button" value="No" name="No" onClick="RunNo">
<p>
<font color="red" face="Times New Roman" size="3"> <b>** Remember to Close Outlook **</font>
</body>