I'm running win2000 sp3 - and have VS.NET 2003 installed - as well as Visual
Studio - and the script debugger.

I'd like to be able to open a test.vbs script in a debugger (not run it in IE,
but as a stand alone ap) and set a breakpoint and run it - but how to accomplish
this simple task eludes me.

What is the best way to do this? I've got some .vbs scripts (that go with some
MS .NET sample code) that do not seem to work - and I'd like to fix them rather
than wait on MS.
--
Thanks in advance, Les Caudle

Re: how to debug .vbs script? by Michael

Michael
Sun Aug 24 22:38:15 CDT 2003

Les Caudle wrote:
> I'm running win2000 sp3 - and have VS.NET 2003 installed - as well as
> Visual Studio - and the script debugger.
>
> I'd like to be able to open a test.vbs script in a debugger (not run
> it in IE, but as a stand alone ap) and set a breakpoint and run it -
> but how to accomplish this simple task eludes me.
>
> What is the best way to do this? I've got some .vbs scripts (that go
> with some MS .NET sample code) that do not seem to work - and I'd
> like to fix them rather than wait on MS.


Start your script with "wscript.exe //d <yourscript> <arguments>". The //d
switch allows the vbscript stop (debugger in jscript) statement to be
honored and enables the "...do you want to debug" popup.

Use the "wscript.exe //x <yourscript> <arguments>" to start the script in
the debugger at the first executable statement.

Cscript.exe supports the same //d and //x switches.

--
Michael Harris
Microsoft.MVP.Scripting

Windows 2000 Scripting Guide
Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp

System Administration Scripting Guide - samples scripts
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942

WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en


Re: how to debug .vbs script? by Les

Les
Mon Aug 25 10:21:59 CDT 2003

Michael - to debug properly, should I install the latest script 5.6 for win2000:
http://www.microsoft.com/downloads/details.aspx?FamilyId=C717D943-7E4B-4622-86EB-95A22B832CAA&displaylang=en

and the scripting debugger:
http://www.microsoft.com/downloads/details.aspx?FamilyId=2F465BE0-94FD-4569-B3C4-DFFDF19CCD99&displaylang=en

which both seem to have dates of 2003 on the web site pages?

Or, how can I look to see which version I have installed and if I need to
upgrade?

Also - I certainly don't want to do anything to mess up VS.NET 2003.

Thanks, Les Caudle

On Sun, 24 Aug 2003 20:38:15 -0700, "Michael Harris \(MVP\)" <mikhar@mvps.org>
wrote:

>Les Caudle wrote:
>> I'm running win2000 sp3 - and have VS.NET 2003 installed - as well as
>> Visual Studio - and the script debugger.
>>
>> I'd like to be able to open a test.vbs script in a debugger (not run
>> it in IE, but as a stand alone ap) and set a breakpoint and run it -
>> but how to accomplish this simple task eludes me.
>>
>> What is the best way to do this? I've got some .vbs scripts (that go
>> with some MS .NET sample code) that do not seem to work - and I'd
>> like to fix them rather than wait on MS.
>
>
>Start your script with "wscript.exe //d <yourscript> <arguments>". The //d
>switch allows the vbscript stop (debugger in jscript) statement to be
>honored and enables the "...do you want to debug" popup.
>
>Use the "wscript.exe //x <yourscript> <arguments>" to start the script in
>the debugger at the first executable statement.
>
>Cscript.exe supports the same //d and //x switches.


Re: how to debug .vbs script? by Michael

Michael
Mon Aug 25 19:38:56 CDT 2003

> ... I clicked on the end debug
> button - and the script continued to run to completion - asking me a
> few more times if I wanted to debug when it encountered errors.
> ...


Those additional prompts when you end the debug session are pretty normal,
and are (AFAIK) the result of the host trying to resume script execution at
a point where an error exists...

The script itself doesn't blow by the error and run to completion just
because the host detaches from the debugger, at least I've never seen a case
where it did...



--
Michael Harris
Microsoft.MVP.Scripting

Windows 2000 Scripting Guide
Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp

System Administration Scripting Guide - samples scripts
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942

WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en