How to Open Visual Studio Code with Admin Privileges to Make Effect of the Installed Extensions

How to open Visual Studio Code with admin privileges to make effect of the installed extensions

To run with superuser:

$ sudo code --user-data-dir=~/root

By the way you will be able to run without setting params in the upcoming patch 1.5.0.

VS Code extension installation without admin rights

After the latest VS Code revision 1.26 (currently 1.25 insiders) it will be possible to install VS Code as a User and also updating all the extensions inside this directory.

See this link VS Code 1.25 release Notes

Visual studio code terminal, how to run a command with administrator rights?

Option 1 - Easier & Persistent

Running Visual Studio Code as Administrator should do the trick.

If you're on Windows you can:

  1. Right click the shortcut or app/exe
  2. Go to properties
  3. Compatibility tab
  4. Check "Run this program as an administrator"
There is a caveat to it though

Make sure you have all other instances of VS Code closed and then try to run as Administrator. The electron framework likes to stall processes when closing them so it's best to check your task manager and kill the remaining processes.

Related Changes in Codebase

  • https://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/8915236-visual-code-w-terminal-integrated-and-super-admin
  • https://github.com/Microsoft/vscode/issues/7407

Option 2 - More like Sudo

If for some weird reason this is not running your commands as an Administrator you can try the runas command. Microsoft: runas command

Examples

  • runas /user:Administrator myCommand
  • runas "/user:First Last" "my command"
Notes

  • Just don't forget to put double quotes around anything that has a space in it.
  • Also it's quite possible that you have never set the password on the Administrator account, as it will ask you for the password when trying to run the command. You can always use an account without the username of Administrator if it has administrator access rights/permissions.

Why can't SynthWave 84 enable Neon Dreams on windows?

I changed this on the file extension.js and worked for me:

Path: C:\Users\"YourUserName"\.vscode\extensions\robbowen.synthwave-vscode-0.1.11\src

    const htmlFile =
base +
(isWin
? "\\electron-sandbox\\workbench\\workbench.html"
: "/electron-sandbox/workbench/workbench.html");

const templateFile =
base +
(isWin
? "\\electron-sandbox\\workbench\\neondreams.js"
: "/electron-sandbox/workbench/neondreams.js");

var htmlFile =
base +
(isWin
? "\\electron-sandbox\\workbench\\workbench.html"
: "/electron-sandbox/workbench/workbench.html");

So, as you can look where it is written "electron-sandbox", it was "electron-browser" before.

After saving these changes, you run as administrator and try again, then it should work.

Visual Studio Code - access denied to unins000.exe

It seems like using the default download is built to be installed in your AppData folder.
Should you want to (like me) install it in your Program Files folder, go to https://github.com/microsoft/vscode/issues/75367 and follow the link there to https://code.visualstudio.com/docs/?dv=win64 and download the exe from there.
This seems to have solved my problem.

Thank you to @Martheen

Installation appears to be corrupt [Unsupported] - Visual Studio Code

Short answer - try vs-code extension Fix VSCode Checksums.

After installation, open command palette and run 'Fix Checksums: Apply'.
Now, just restart your vs-code.

or

Alternatively, open command palette and write 'Developer: Reload Window'.

That's it.

This fixes the issue for me as well (If you ever have any problems/doubts and wanted to undo what you just did, open command palette and execute 'Fix Checksums: Restore').


Details - I was having the same issue after installing 'SynthWave 84 theme' and 'Enable Neon Dreams' (that glow effect), as mentioned by answers above.

I searched for it and even though vs-code documentation suggested to re-install the VS Code (as mentioned in the second answer), I was willing to search for another possible solution.

so, I found this section on 'SynthWave 84' extension official page.

thus, just wanted to add another possibility to this question, which may help someone.

I will be following this and if it causes any issue in VS Code updates or anything related, I will provide an update.

JFYI - I am on macOS Catalina, but I am sure it will be the same for windows as well and vs-code September 2020 (version 1.50)

Mac OS - Run VS Code with admin privileges so the changes can be applied

I think you just have to run VS Code with admin privileges. I found this article that explains how you can do that.

https://www.wikihow.com/Open-Applications-With-Root-Privileges-on-a-Mac



Related Topics



Leave a reply



Submit