How to Open .exe Files in Visual Studio Code

EXE stands for executable. An EXE file is an executable program you can run in Microsoft Windows. If you want to debug an executable (.exe file) directly, you may need to open it in the editor. This article will show how to open .exe files in Visual Studio Code. You’ll also learn to run the .exe file in the VS Code terminal.

Opening EXE files in VS Code

To open an EXE file for an existing project, do the following:

  1. In VS Code, select the Open File option from the “File” menu. Alternatively, press Ctrl + O in Windows/Linux or Cmd + O in Mac OS

    Open File
    From the top-level File menu, select the Open File option.
  2. In the “Open File” dialogue box, navigate to your .exe file, select it, and click on the Open button

    Dialog Box
    Open the .exe file from your preferred directory.
  3. When prompted with the following error, select the Open Anyway button.

    Open Anyway
    Click on the Open Anyway button.
  4. A palette will open in the center of the VS Code to choose the editor. Choose the Text Editor option. It will open the .exe file in text format.

    Text Editor
    Choose Text Editor as the editor.

Running EXE files in VS Code

To run an EXE file inside VS Code, do the following:

  1. Open the Extensions view or press Ctrl + Shift + X in Windows or Shift + Cmd + X in Mac OS. Inside the search bar, type “exe runner”.

    Extensions Tab
    Go to the Extensions view and search for “exe runner”.
  2. Select the extension and click on Install.

    Install Extensions
    Click on the Install button.
  3. Right-click inside the code editor and select the Run Executable. Alternatively, you can press the Run Executable button on the top-right corner. It will run the .exe file in the VS Code terminal.

    Run Executable
    Right-click and choose the Run Executable option.

Was this article helpful?

Leave a Comment