If the script debugger does not automatically come up - which happened to me recently on a new machine - you'll need to do what I call "Activating" the script debugger. Run the VBScript using a command similar to the following (path to your testdebug.vbs file may be different) from a command prompt or from within Start/Run: wscript testdebug.vbs If the debugger comes up automatically, you should now be able to debug scripts written for SecureCRT by including the "stop" keyword within your script code (Step 3 below). These are the steps I followed (not sure which ones are "required", but after I did these things, the "Stop" keyword worked to bring up the debugger): - Write a simple VBScript that uses the "Stop" keyword. Sometimes this step may not be necessary, but I just ran into an experience with a new computer recently in which the keyword "Stop" had no effect with respect to launching the script debugger. Install the Microsoft Script Debugger tool:ĭownload and install the Microsoft Windows Script Debugger for your particular Windows platform from the Microsoft scripting site: 2. Include the keyword "stop" within the script you are running, just above the point in the script that you would like the debugger to be launched.ġ.Install the Microsoft Script Debugger tool.Microsoft documentation for the debugger states, "If you have installed an alternative scripting language that supports host-independent debugging, such as REXX or Perl, you can also debug scripts in that language", but I can't speak from experience with respect to perl so the example given below is provided in VBScript. Just say "yes.I haven't personally used the script debugger with the perl language, but debugging VBScripts that run in SecureCRT should be possible by using the following steps. Or, if your script hits an error or a VBScript STOP statement, you'll get a dialog asking whether or not to debug. Then start the script via cscript/wscript with /d or load your HTM/HTA as usual with debugging ON in IE.įrom Script Debugger you can browse running scripts and connect to the one you want to debug. Then just be sure to flip all of those switches on that I mentioned. You can't just "run" a script file loaded or created in Script Debugger directly. If you use it to write a script, save the script file out. Even though it can be used to edit HTML, ASP, and even VBS or JS scripts, they stopped short of making it the nice little IDE it could have been. It's well worth spending a few hours on it when you get the chance though. Script Debugger can seem a little frustrating at first. Like any tool, even NotePad, it takes some time to get to the point where you can do things without always looking up details. See the Help in Script Debugger for more information, or read Introducing Microsoft Script Debugger RE: Debugging Narizz28 (MIS) 21 Apr 04 20:05īe sure and put in a little time to learn your way around one or both of the debuggers. Set breakpoints, examine or change data, resume execution, see source code and have the point of failure highlighted. This is the "real" way Windows script is debugged, even though we all resort to a bunch of MsgBox calls at times. Debugging ASP Scripts, Server Script Debugging, etc. There are also techniques to use either of the two script debuggers with server-side ASP pages. To debug a WSH script, be sure to start cscript or wscript with the /d switch.Īlso, see HOWTO: Switch Between the Visual InterDev Debugger and the Microsoft Script Debugger as Default JIT Debugger if this is a relevant issue for you. To debug an HTA or an HTML page, be sure to turn on script debugging via IE's Internet Options' "Advanced" tab (Control Panel or IE's Tools menu). Use either the debugger in Visual Studio or the free one you should already have installed (see Microsoft Windows Script Downloads).īe sure to turn on script debugging via the appropriate registry key setting, default is "no debugging." VBScript 'Stop' Statement Does Not Start Script Debugger
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |