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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WScript.Sleep giving an error

Status
Not open for further replies.

Payo10

MIS
Oct 11, 2011
9
0
0
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>
 
The wscript object is not available in HTML.

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Any ideas on how to pause the code in this enviroment?
 
window.setTimeOut

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
didn't you already solve this problem in thread329-1663298?

-Geates


"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Yes, that problem was resolved by the addition of the last script there. This new script is also part of that HTA file. I really appreciate all your help. And just when I think I'm done with the program, "the upper management" will come up with something new so I'll probably be back with more on this.

Again, thank you,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top