Serpen / VBS-VSCode

VSCode VBScript language extension
https://marketplace.visualstudio.com/items?itemName=Serpen.vbsvscode
MIT License
24 stars 11 forks source link

Support x64 or x86 versions of cscript #51

Closed mtaylorfsmb closed 3 years ago

mtaylorfsmb commented 3 years ago

Describe the bug Attempting to test a vbscript file that uses an x86 COM component fails because VS Code tries to use the x64 version instead. Therefore it is unable to locate the COM component.

Code

Set provider = CreateObject("SomeComObjectOnlyDefinedForx86")

To Reproduce Steps to reproduce the behavior:

  1. Attempt to create a COM object that is only available in x86
  2. Run the debugger and the script fails because it appears CScript is the x64 version, not x86

Expected behavior Should be able to configure the CScript version to use via the launch.json. Ideally let me select the version of CScript and pass arguments to it in case I need to do more than what the existing launch.json settings allow.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Serpen commented 3 years ago

Please use the config variable vbs.interpreter and set the path to c:\Windows\SysWOW64\cscript.exe

CoolDadTx commented 3 years ago

Please be more specific or point me to the documentation for this. This option is not valid in launch.json so how would I set this up so I can open a folder in VS code and debug VBS scripts there using x86 version?

Serpen commented 3 years ago

Hi please read the VSCode Beginner Documentation how Settings work: https://code.visualstudio.com/docs/getstarted/settings Search there for the setting name and config it to your prefered vbs interpreter. VSCode has settings, which can be configured per Machine, User, Workspace, Language, etc. Most extensions contributes settings, you can see them, when you click on an extension and on the extension tab "contributions".

CoolDadTx commented 3 years ago

Thanks for the info. I'll go this route to get past my issue.

Still I believe that most VBS code assumes x86 and therefore would benefit from either defaulting to that or making it configurable via the debug launch settings so we can run either way without changing the workplace settings.

Serpen commented 3 years ago

Couldn't agree. I'm using the default setting Windows is using when you double click an vbs file which is x64. When you double click your vbs file with the bitness problem you should get same error