Visual Studio 2017 debugging vbscript

steff123 picture steff123 · May 28, 2017 · Viewed 18k times · Source

I'd like to debug a vbscript with Visual Studio 2017 Community Edition and followed the steps mentioned here for VS2015:

Video

I entered

cscript.exe /x foo.vbs

in the commandline, but no debugger starts. Is there a problem with the 2017th version of VS or are there some steps (e.g. configuration steps in VS) which 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 too

Thanks steff

Answer

Niederee picture Niederee · May 8, 2018

Neither of those solutions worked for me. Found a workaround on MSDN

  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 '.
  7. In 'Debugger type' change it to script.
  8. Close project properties.
  9. Hit F10.