VSCode更新失败解决办法

VScode更新失败的完美解决办法

一.原因
VScode不是安装在默认位置,更新程序找不到Code.exe

Failed to install VS Code update.
Updates may fail due to anti-virus software and/or runaway
processes. Please try restarting your machine before attempting to
update again.
If update fails repeatedly, please attach the following log fle to a new
issue on GitHub:
C:\Users\yonghu\AppData\Local\Temp\vscode- inno-updater- 1676572541.log

二.解决办法

以管理员身份运行打开CMD

以管理员身份运行以下两条命令,安装位置自行输入

rd /s/q "%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code" & mklink /D "%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code" "你的VScode安装位置文件夹"
1

三.再次打开VScode就可以正常更新了


rd /s/q "%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code" & mklink /D "%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code" "D:\Program Files\Microsoft VS Code"