Debug Visual Studio 2017 vbscript

I would like to debug vbscript with Visual Studio 2017 Community Edition and followed the steps given here for VS2015:

Video

I entered

cscript.exe /x foo.vbs

      

on the command line, but the debugger won't start. Is there a problem with the 2017 version of VS or are there some steps (like setup steps in VS) that are not shown in the video?

Edit: I tried cscript.exe //X foo.vbs

, cscript.exe foo.vbs //X

, cscript.exe //X //D foo.vbs

and cscript.exe foo.vbs //X //D

also

Thanks Steff

+3


source to share


3 answers


Please run VS2017 as Administrator and then enable the script option under TOOLS-> Options-> Debugging-> Just-In-Time and then debug it again.

enter image description here



Even if I didn't use the VS2017 community version, but I get the same problem, I found it related to JIT debugging on my side using the VS2017 Enterprise version and it works well after I enable it:

enter image description here

+3


source


CSCript.exe requires double-sided slashes for its own command line parameters, as one-bit arguments are passed to the script itself.

You want cscript.exe //X

not cscript /X

.



I also suggest an argument //D

so that it breaks immediately.

+1


source


None of these solutions worked for me. MSDN workaround found

1. Start Visual Studio
2. File->Open Project
3. Point it at c:\Windows\system32\cscript.exe (or wherever your windows install directory is)
4. When you get the elevation permissions dialog, click 'Ignore'
5. Go to project properties on the cscript.exe node
6. In arguments add '//d <path-to-your-script>'
7. In 'Debugger type' change it to script
8. Close project properties
9. Hit F10

      

0


source







All Articles