15

[Windows 10] I have "Microsoft VS Code (User Setup)" installed in a custom directory and whenever I try to update it this shows up:

Error Prompt 1

and then this

Error Prompt 2

Log Info Dec 23 11:42:40.673 INFO Starting: C:\Users\jeremy\AppData\Local\Programs\Microsoft VS Code\Code.exe, false Dec 23 11:42:40.674 ERRO Bad arguments: Code path doesn't seem to exist: C:\Users\jeremy\AppData\Local\Programs\Microsoft VS Code\Code.exe 

How do I change the path to point it to the right directory where "Code.exe" exists?

6
  • Can you attach a log file that is listed at the bottom of the error window? Commented Dec 23, 2018 at 13:37
  • @Victor S. Oops, forgot to put in the Log Info, Thank you for reminding me. Edited and Inserted. Commented Dec 24, 2018 at 3:26
  • Is the path in the Windows Path variable correct? Commented Dec 24, 2018 at 9:30
  • @VictorS. I changed it to the proper directory (Yes, and restarted) but whenever I run VS Code and try to update, it automatically changes my path back to "C:\Users\jeremy\AppData\Local\Programs\Microsoft VS Code\bin" (Which is NOT the right directory!). Why is that?? Commented Dec 26, 2018 at 2:40
  • 1
    You can try reinstall stackoverflow.com/a/49175984/7676971. Commented Dec 26, 2018 at 7:41

3 Answers 3

11

I had the same problem recently. I ended up reinstalling VS Code.

Do I lose my settings?

No. Note that I did not uninstall VS Code, I just downloaded the installer from the website and installed VSCode. This won't hurt, as it does not touch your settings and extensions.


What I tried

I first tried to visit the path mentioned in the error log, and I noticed that the folder _ within that directory contained the new VS Code version, downloaded by the updater.

So the path should have been C:\Users\myusername\AppData\Local\Programs\Microsoft VS Code\_\Code.exe instead, perhaps.

I tried to move all files from _ to their parent directory, and then, in VS Code, Help » Restart to update. This opened the new version of VS Code, but after closing it and starting it from the original install location (or through a shortcut I have always been using), the old version was still loaded. So apparently, this "trick" didn't work.

Then I tried to make a symbolic link to Code.exe within the _ directory, so the VS Code updater would find Code.exe. This caused roughly the same things to happen. So, this didn't work either.

At last, I decided to just download VS Code from their website, and simply install it. This seemed the most simple option to me.

Sign up to request clarification or add additional context in comments.

4 Comments

Did you install it in the same custom folder as before? Or did you install it in the default location (somewhere in C:)?
@ArvindhMani If I remember correctly, the installer didn't even ask the install location, as I chose to reinstall.
Gotcha, thanks. I did the same thing and noticed that my old VSCode install folder (the one with the "_") was unaffected. So in effect, I had two Code executables after the reinstall. I wasn't really comfortable with that and ended up fully uninstalling and re-installing (to the default location this time).
I had to use the System Installer, not the User Installer (which is currently downloaded with the unmarked big button on the website), in order to be able to choose a custom installation directory. I'm not sure which version/installer I had before.
1

Create a hard link for Code.exe using mklink, works for me.

Command should look like this (depends where your custom installation is, my in C:/Program Files/Microsoft VS Code/):

mklink /H "C:/Users/$username/AppData/Local/Programs/Microsoft VS Code/Code.exe" "C:/Program Files/Microsoft VS Code/Code.exe" 

1 Comment

I got: The system cannot move the file to a different disk drive. My VSCode is on D:
0

This works :

mklink /J "C:/Users/$username/AppData/Local/Programs/Microsoft VS Code/" "C:/Program Files/Microsoft VS Code/" 

Please, be careful with the permission on the source folder. Should work on any drive.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.