Payo10
MIS
- Oct 11, 2011
- 9
Can anybody tell me or give me an idea of why my WScript.Sleep is not working and giving out an error "Object required: 'WScript'" Here is my code, by the way this code is inside a HTA file.
<script language = "VBScript">
Sub Window_OnLoad
idTimer = window.setTimeout("PausedSection", 5000, "VBScript")
End Sub
Sub PausedSection
Dim a
a = 0
if window.frames(0).location.href = " Then
OpenFile
window.close
End If
Do Until a = 1
Set objShell = CreateObject("Wscript.Shell")
objShell.Run ("C:\scripts\message.hta"), 1, True
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 5000
Loop
End Sub
</script>
<script language = "VBScript">
Sub Window_OnLoad
idTimer = window.setTimeout("PausedSection", 5000, "VBScript")
End Sub
Sub PausedSection
Dim a
a = 0
if window.frames(0).location.href = " Then
OpenFile
window.close
End If
Do Until a = 1
Set objShell = CreateObject("Wscript.Shell")
objShell.Run ("C:\scripts\message.hta"), 1, True
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 5000
Loop
End Sub
</script>