This project has moved. For the latest updates, please go here.

debugging vbscript

Feb 11, 2015 at 12:53 PM
I tryed the code with a C# exe. This works fine.

Now I try to start a vbs file with the debugger.
In CorDebugger.cs I change the code for just trying that.

string sCmd = @"C:\Windows\System32\cscript.exe C:\Data\args.vbs";
        ICorDebugProcess proc;
        codebugger.CreateProcess(
                            //exepath,
                            null,
                            //exepath,
                            sCmd,
                            null,
                            null,
                            1, // inherit handles
                            //0,
                            (UInt32)CreateProcessFlags.CREATE_NEW_CONSOLE,
                            new IntPtr(0),
                            @"C:\Data",
                            si,
                            pi,
                            CorDebugCreateProcessFlags.DEBUG_NO_SPECIAL_OPTIONS,
                            out proc);
That seems to run the script, but does not stop at the begin. The script runs to the end. No breakpoint event has fired.
How could I get it behave like with the C# exe?
Coordinator
Feb 14, 2015 at 4:15 PM
Unfortunately, this won't work as mindbg is able to debug only managed applications and you are trying to run a native scripting host. Maybe you should try a cscript debugging options as described here: http://geekswithblogs.net/SoftwareDoneRight/archive/2008/04/14/quicktip-debugging-vbs-files-with-cscript.exe-and-visual-studio.aspx.