Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > VBScript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 25th, 2004, 03:08 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hung script

Salutations

How to interupt hung script if it does not return any err code just stops responding (exception handling is impossible).

thanx in advance

regards
__________________
regards
Reply With Quote
  #2 (permalink)  
Old November 26th, 2004, 10:57 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

If it is running in the CMD console, use <CTRL>C to break the script.

If it is not running in the console, then use <CTRL><SHIFT><ESC> and stop the wscript.exe process.



mmcdonal
Reply With Quote
  #3 (permalink)  
Old December 8th, 2004, 10:00 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

In spite of your rude email to me not to respond to your help requests...

   If you want to stop the script from within the script - which you don't mention in your post - then you can either use a counter if you think it is caught in a loop, or use a time-out device if you know the script should never take more than a certain amount of time.

Ex 1: This script limits iterations to 20
'==========================================
i = 0

Do Until i = 20
    WScript.Echo i
    i = i + 1
Loop
'==========================================

Ex 2: This script shuts down after 5 seconds, even though the code will take a lot longer than that to execute.
'==========================================
WScript.Timeout = 5
i = 0

Do Until i = 3000000
    WScript.Echo i
    i = i + 1
Loop
'==========================================



mmcdonal
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check whether a program is running or hung cici Pro VB 6 0 October 13th, 2006 10:55 PM
Hung up on Ch 2, Pg 53 - new to VB xxxiii BOOK: Expert One-on-One Access Application Development 4 July 20th, 2006 09:25 AM
My application is hung when I send WM_COMMAND mehdi62b C# 5 October 6th, 2004 05:43 PM
Call and run CGI script from a PHP script ... how? dbruins BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 June 10th, 2003 03:09 PM



All times are GMT -4. The time now is 04:46 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.