How to open command prompt as administrator on Windows
Windows command prompt by default will launch without administrative privilege even if the user is an Administrator. You will get an access-denied error when running commands that require administrative privilege at the command prompt.
C:\Users\user>net user newuser /add System error 5 has occurred. Access is denied.
To open the command prompt and run commands with administrator privilege, you need to run the Command Prompt app as administrator.
Steps to run command as administrator on Windows 11 command prompt:
Make sure your user has Administrator privilege.
Search for command prompt on the search bar.
Right click on Command Prompt.
Click on Run as administrator.
Click Yes on the User Account Control window to allow Command Prompt to run with administrator privilege.
Execute command with administrator privilege.