VisualStudio 代码安装位置

我几天前安装了 VisualStudio 代码,现在在我的机器上找不到可执行文件。在哪里?

我已经检查了程序和特性。我也检查了我的 PATH。由于某些原因,它不在任何一个。

139120 次浏览

Okay. I found it in the docs.

C:\Users\my.user\AppData\Local\Code\app-0.1.0

Update 10.11.2018

If you do a complete re-install, including uninstalling prior versions of code installed on your machine the new version will be installed at

C:\Users\{UserName}\AppData\Local\Programs\Microsoft VS Code

Update 06.07.2018

Since Version 1.25 VS Code supports portable mode. Instructions on how to use this are documented here.

You will need the ZIP file download version - not the installer. After unzipping the contents of the archive, create a data folder inside the folder, where code.exe is located. All settings will now be saved there and can be brought along with you.

|- VSCode-win32-x64-1.25.0-insider
|   |- Code.exe (or code executable)
|   |- data
|   |- ...

On macOS, the folder must be named code-portable-data and has to be a sibling of the app itself. Not inside the app.

|- Visual Studio Code.app
|- code-portable-data

The reasoning behind this can be read here: What is VSCode User Setup for Windows?


Update

If you are using the x64 version, the path is:

C:\Program Files\Microsoft VS Code\
C:\Program Files\Microsoft VS Code\Code.exe

Original answer

At this point and time (Version 1.19.2) Vs code no longer resides in your AppData folder, but under

C:\Program Files (x86)\Microsoft VS Code\
C:\Program Files (x86)\Microsoft VS Code\Code.exe

I used the new VSCode User Setup installer on Windows 10, and found the executable here:

C:\Users\my-username\AppData\Local\Programs\Microsoft VS Code\

There are two types of installer available for VSCode. Go to link to find type of installer you want.

If you are using/going for User Installer, the version will be installed at:

C:\Users\{UserName}\AppData\Local\Programs\Microsoft VS Code

If you are using/going for 64bit System installer, the version will be installed at:

C:\Program Files\Microsoft VS Code\

If you are using/going for 32bit System installer, the version will be installed at:

C:\Program Files (x86)\Microsoft VS Code\

If you prefer username-agnostic path strings:

  • folder: %HOMEPATH%\AppData\Local\Programs\Microsoft VS Code\

  • executable: %HOMEPATH%\AppData\Local\Programs\Microsoft VS Code\bin\code

If you also want to use those path strings inside C#/C++ code:

  • folder: "\"%HOMEPATH%\\AppData\\Local\\Programs\\Microsoft VS Code\\\""

  • executable: "\"%HOMEPATH%\\AppData\\Local\\Programs\\Microsoft VS Code\\bin\\code\""

The way I find most intuitive and easy to remember is:

  1. Search for Visual Studio Code in the Windows 10 search bar -> right-click -> Open File Location

    For me this goes directly to:

    C:\Users\{YOUR_NAME}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Visual Studio Code

  2. Right-click on the shortcut -> Properties -> Start in:

    "C:\Users\{YOUR_NAME}\AppData\Local\Programs\Microsoft VS Code"

If for some reason none of the other answers work, try this:

  1. Go into your vscode settings

  2. Find any setting that has 'Edit in settings.json' (for example - Color Customizations)

  3. Press ctrl+shift+s

  4. Go one folder up

  5. Copy + paste the file location (on the top for windows) into into another file explorer

  6. Profit

Why default your program would be installed here..

C:\Program Files\Microsoft VS Code\

If you have chosen different directory while installing it you can get it by:
1. Go to the icon location
2. Right click open properties
3. Check target

I found it at

C:\Users\%username%\source\repos\Notes\%VSCode-folder%\bin\Debug\

Where %username% is the user and %VSCode-folder% is the VSCode project

The difference is:
System Installer will install VSC in C:\Program Files\Microsoft VS Code\
User Installer will install VSC in %HOMEPATH%\AppData\Local\Programs\Microsoft VS Code\

Search for the files with respect the version installed.