Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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




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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.