Config Server Firewall

How to Always Run VS Code as Administrator

In this guide, I will show you how to set VS Code to always run as an administrator.

By default, when you launch VS Code, it doesn't have administrative privileges. This can be an issue if you're running scripts or terminal commands that require them. Manually right-clicking the launch icon and selecting "Run as Administrator" is an option, but it isn't very convenient to do every time.

To set VS Code to run as an administrator by default, follow these steps:

  1. Right-click the VS Code launch icon and select Open file location.
  2. In the new window that appears, right-click the shortcut for VS Code and choose Properties.
  3. In the Properties window, go to the Compatibility tab.
  4. Here, check the box that says Run this program as an administrator.
  5. Click Apply and then OK.

From now on, VS Code will run as an administrator by default every time you open it.

Run VSCode as Administrator

Why You Might Need This

By default, when you run scripts or terminal commands inside VS Code, some of them may require administrative privileges.

Run VS Code with Admin Privileges

In such cases, if VS Code is not running as administrator, the command may fail or show a permission error.