HTA help

How can I get the page to complete loading before it runs the copy file operation?

<HTML>
<HEAD>
<TITLE>_______________________________________________</TITLE>
<HTA:APPLICATION
MaximizeButton=no
MinimizeButton=no
SysMenu=no
Border=thin
scroll=no
>

<SCRIPT LANGUAGE = “VBScript”>
<!-- Start Hiding VBScript statements

Sub Window_onLoad
window.moveTo (screen.width -390) /2,(screen.height -460) /2
window.resizeTo 390,460
wscript.sleep 500
set objFS = CreateObject(“Scripting.FileSystemObject”)
Source = “G:\folder a\Config”
Target = “C:\folder b\Config”
objfs.copyfolder source, target
window.close()
End Sub

'End hiding VBScript statements –>
</SCRIPT>

</HEAD>

<BODY>

<FORM NAME=“myform”>

<p align=“center”><span style=‘font-size:18.0pt;font-family:“Arial Black”;color:red’>Updating Typhoon Data</span></p>
<p align=“center”><img src=“trilogi.bmp” v:shapes=“_x0000_i1025”></p>
<p align=“center”>This window will close once the update is complete</p>
<P>

</P>

</FORM>

</BODY>

</HTML>

in anticipation, Thanks DT

wscript.sleep is a wsh method, which I don’t think work in a hta environment, there is a work round by using the time function.

biab :wink:

found it on technet

So something along the lines of


<SCRIPT LANGUAGE = "VBScript">
<!-- Start Hiding VBScript statements

Sub Window_onLoad
window.moveTo (screen.width -390) /2,(screen.height -460) /2
window.resizeTo 390,460

iTimerID = window.setInterval("doCopyFiles", 5000)

End Sub 

Sub doCopyFiles

set objFS = CreateObject("Scripting.FileSystemObject")
Source = "G:\folder a\Config"
Target = "C:\folder b\Config"
objfs.copyfolder source, target
window.close()

End Sub

'End hiding VBScript statements -->
</SCRIPT>

DT.

YOU ARE A STAR!

Pint headed your way at Mojo’s