To debug standalone (WSH hosted) script...
In WSH 2.0, set HKCU\Software\Microsoft\Windows Script\Settings\JITDebug = to 1 (DWORD value). Then
start your script with "wscript //d yourscript.vbs " to allow the "stop" statement to be honored. Or
use the syntax "wscript //x yourscript.vbs " to start the script in the debugger (no stop statement
needed).
--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--
"Dorel" <sil...@bezeqint.net> wrote in message news:3adb...@news.bezeqint.net...
"Michael Harris" <Please....@To.NewsGroup> wrote in message
news:uPeoehqxAHA.2252@tkmsftngp02...
"John Zullo" <jo...@gmsint.com> wrote in message
news:ePpoqBrxAHA.572@tkmsftngp05...
> That did the trick! Thanks
>
> "Michael Harris" <Please....@To.NewsGroup> wrote in message
> news:uPeoehqxAHA.2252@tkmsftngp02...
> > In IE hosted script, just use window.alert() or confirm() or prompt().
> >
> > To debug standalone (WSH hosted) script...
> >
> > In WSH 2.0, set HKCU\Software\Microsoft\Windows Script\Settings\JITDebug
=
> to 1 (DWORD value). Then
> > start your script with "wscript file://d yourscript.vbs " to allow the
"stop"
> statement to be honored. Or
> > use the syntax "wscript file://x yourscript.vbs " to start the script in
<?component debug="true" error="true"?> processing instruction to the WSC source file...
For a WSF file, add
<?component debug="true" error="true"?> processing instruction to the WSF source file...
The error attribute isn't strictly needed to debug, but it certainly helps ;-)...
--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--
"Shannon" <sh...@envivid.com> wrote in message news:OHC6VVsxAHA.940@tkmsftngp02...
My wsc file contents are as follows:
<?xml version="1.0" encoding="windows-1252"?>
<component debug="true" error="true"?>
<registration
description="This is the test for WSC"
progid="WSHTest"
version="1.00"
classid="{bb5c2477-c458-41c1-9d45-7c9d77efb004}">
<script language="VBScript">
<![CDATA[
Function register()
MsgBox "Component 'WSHTest' registered."
End Function
Function unregister()
MsgBox "Component 'WSHTest' unregistered."
End Function
]]>
</script>
</registration>
<public>
<method name="WSHTest"/>
</public>
<script language="jscript">
<![CDATA[
var description = new WSHTest;
function WSHTest()
{
return "test";
}
]]>
</script>
</component>
And then the javascript file that calls this guy has the following contents:
debugger;
WScript.Echo("This machine is running " + WScript.Name + ", version " +
WScript.Version);
var objNewCharger = WScript.CreateObject("BaddaBing");
WScript.Echo("-*-*-* Test *-*-*-");
var txtTmp = objNewCharger.WSHTest();
WScript.Echo(txtTmp);
"Michael Harris" <mik...@mvps.org> wrote in message
news:#qW9a0txAHA.1752@tkmsftngp04...
"Shannon" <sh...@envivid.com> wrote in message
news:em2bbF2xAHA.1332@tkmsftngp04...
<component>
<?component debug="true" error="true"?>
And take the time to read the documentation ;-)...
--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--
"Shannon" <sh...@envivid.com> wrote in message news:em2bbF2xAHA.1332@tkmsftngp04...
var description = new WSHTest;
--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--
"Shannon" <sh...@envivid.com> wrote in message news:em2bbF2xAHA.1332@tkmsftngp04...