8

I recently reinstalled my windows 10
For easy software management I chose to install all my software in the following directories:

  • C:\Program Files\
  • C:\Program Files (x86)

This meant installing vscode and vscode-insiders on the C:\Program Files\
instead of the default C:\Users\User\AppData\...\

However when I am working I get notified with the following popup:
Error, Access is denied

clicking > Try again gives the same popup instantly
clicking > Cancel installation removes the popup for a short period
clicking > Skip this file keeps giving kind of the same access is denied error

2
  • 1
    Try running vs code in administrative mode
    – MBB
    Aug 26, 2020 at 9:38
  • Yeah figured that out but I open vscode almost always via open code with: Open with Code from right click or command line. I got it working from the right click. Aug 26, 2020 at 9:49

1 Answer 1

12

The error comes from vscode wanting to update in the background.
The C:\Program Files\ and C:\Program Files (x86) are restricted to admin
So running vscode in admin mode will fix this issue.

To make sure vscode runs in admin mode via this:
Open with Code

We need to make sure it always runs in admin mode:

Opening the Code.exe with properties (right click and then properties).
Switch to the Compatibility tab and tick the box before:
Run this program as an administrator
Remember do this only when you know what you are doing.
Your are giving admin / sudo powers to vscode

enter image description here

This will fix the popup error.

4
  • This is definitely not a proper way to solve it Jun 16, 2022 at 7:58
  • @HirasawaYui I like to invite you for a proper way to solve it Jun 18, 2022 at 13:37
  • I really wish I knew how to do that. I've ended up reinstalling my vs code, because running with admin permissions was not an option for me. Jun 18, 2022 at 16:40
  • I personally don't have a big issue with it. I only use this solution on my personal computer and I did manage to have the terminal not run as administrator Jun 20, 2022 at 15:41

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.