TessavWalstijn
TessavWalstijn

Reputation: 1726

vscode installed in other directory gives access denied error

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

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

Upvotes: 8

Views: 9180

Answers (2)

Kardo Paska
Kardo Paska

Reputation: 584

It seems there is a new option to disable background updates that sneakily wants to install stuff.

In the file >> preferences >> settings, search for "update" and find the section under application.

I stopped getting these popup warnings by unchecking the Update: Enable Windows Background Updates option.

enter image description here

Upvotes: 0

TessavWalstijn
TessavWalstijn

Reputation: 1726

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.

Upvotes: 11

Related Questions