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.

Author: Mohd
Shakir Zakaria
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.

Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Discuss the article:
Comment anonymously. Login not required.