DEV Community

Syed Saadullah Shah
Syed Saadullah Shah

Posted on • Updated on

How to Run VS Code Terminal as Administrator

If you are using Visual Studio Code, you may find that you need to run the terminal as an administrator in order to perform certain tasks. Fortunately, this is easy to do.

Open Visual Studio Code (VS Code) on your computer.

Once VS Code is open, click on the "View" menu at the top of the window.

From the "View" menu, select "Integrated Terminal" to open the terminal in VS Code.

In the terminal window, you will see a dropdown button with the default shell selected (e.g., PowerShell, Command Prompt, etc.). Click on the dropdown button to open a menu.

In the menu, you will find an option called "Select Default Shell." Hover over this option, and you will see two more options: "Create New Integrated Terminal" and "Select Default Shell."

Hold down the "Shift" key on your keyboard and right-click on the "Select Default Shell" option.

After right-clicking, you will see an additional option in the context menu: "Run as administrator." Click on this option to open the terminal as an administrator.

If a User Account Control (UAC) prompt appears, asking for permission to make changes to your computer, click "Yes" to proceed.

The terminal will now open with administrative privileges, indicated by "Administrator" in the terminal's title bar.

You can now run commands or perform actions that require administrative privileges in the VS Code terminal.

Please note that the ability to run the VS Code terminal as an administrator depends on your user account's permissions on the system. If you don't have administrative privileges on your account, you may need to contact your system administrator or switch to an account with administrative rights.

Top comments (3)

Collapse
 
eissorcercode99 profile image
The EisSorcer

I am struggling here. Please clarify the instructions

Collapse
 
evanthechong profile image
Info Comment hidden by post author - thread only accessible via permalink
evanthehcong

Sorry but this advice doesn't work for me, when i right click on the terminal it just copy pastes the last thing copied to the clipboard. Could you provide further details or photos?

Collapse
 
aleksandrsipavin profile image
Info Comment hidden by post author - thread only accessible via permalink
Aleksandr Sipavin

This is absolutely incorrect and not possible

Some comments have been hidden by the post's author - find out more