|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Urgent: WScript Help
Hello,
I am pretty new to VBScript and WScript and I am having a major problem that I need to fix before a demo tomorrow. It might just be something simple that I am doing wrong. Any help is greatly appreciated. My project is basically a web based video player and it has a play subroutine and a stop subroutine. I have a while loop in my play sub. that keeps running til the end of the video. Inside this while loop I use the sleep method of Wscript to slow down the loop since I only need info. from the loop every 2 seconds or so. The problem is I cannot seem to quit the WScript. When the user clicks on the stop button the stop sub is called and I call WScript.Quit in my stop sub. But I get an error message saying "Object required" at that line. Here is a part of the code I am working on: dim WshShell dim breakOut sub play set WshShell = CreateObject("WScript.Shell") while(breakOut = 0) Call WshShell.Run("C:\sleep.vbs", ,true) wend end sub sub stop WScript.Quit end sub The sleep.vbs file just has one line in it: WScript.sleep 500 Please let me know if you know why WScript won't quit. Without it quitting I can't close IE. Thank you for your time and help. Vijai |
|
#2
|
||||
|
||||
|
Try WScript.Quit 1
Depending on your version of windows that you are running, you probably have a wscript help manual on your machine. Search for WSH.CHM which is the compiled help manual. Also, your subject title in unacceptable. You can refer to the sticky thread at the top of this forum for more information on how to post a question. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Urgent: WScript Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|