PRB: VBScript 'Stop' Statement Does Not Start Script Debugger

Veralteter Haftungsausschluss für KB-Inhalte

Dieser Artikel wurde für Produkte geschrieben, für die Microsoft keinen Support mehr anbietet. Deshalb wird dieser Artikel im vorliegenden Zustand bereitgestellt und nicht mehr aktualisiert.

Symptoms

When using Microsoft Visual Basic Script's STOP statement to halt and display script in the Microsoft Script Debugger or Microsoft Visual InterDev 6.0, the STOP statement might fail to work.

Cause

This problem is caused by a modification to VBScript. In versions 5.0 and earlier, the STOP statement launches the script debugger. However, occasionally scripts running unattended on servers could also bring up the script debugger when encountering a STOP statement and then appear to hang. In order to alleviate this problem, a Registry key has been added that indicates whether the user wishes the debugger to be launched. This key is turned off by default in version 5.1 of the script engines.

Resolution

In order to re-enable the STOP statement, users can manually set the Registry key to indicate that they want the script debugger to be launched when a STOP statement is encountered. The Registry key is:


HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings
Inside this key is a value called JITDebug. Set the value of this key to 1 to re-enable the STOP statement. Note that if you are using WScript, you need to add the /d command line option to enable debugging.

Status

This behavior is by design.

References

For additional information about handling run-time errors in a script host, please click the article number below to view the article in the Microsoft Knowledge Base:
232394 HOWTO: Catch Run-time Errors in an ActiveX Script Host
Eigenschaften

Artikelnummer: 252895 – Letzte Überarbeitung: 19.06.2014 – Revision: 1

Feedback