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:

  1. Make sure your user has Administrator privilege.
  2. Search for command prompt on the search bar.
  3. Right click on Command Prompt.
  4. Click on Run as administrator.

  5. Click Yes on the User Account Control window to allow Command Prompt to run with administrator privilege.
  6. Execute command with administrator privilege.