Struggling with “Access is denied” in CMD? Here’s how to switch administrator in CMD on Windows 10, including the CMD command to become admin for any account.
Most of the time, you can use Command Prompt with a standard user account for everyday tasks. But when a command needs higher permissions, Windows 10 requires you to open an elevated Command Prompt with administrator privileges before it will run.
If you’re looking into how to switch administrator cmd, you’re likely trying to do one of two things: open Command Prompt as an administrator so you can run commands with elevated privileges, or change a user account to an administrator directly from CMD. These are related but distinct tasks, and knowing which one you need saves you from running into repeated Access is denied errors.

Windows 10 provides straightforward ways to handle both. Once you understand the difference between elevating a Command Prompt session and changing an account’s privilege level, you can pick the right method the first time.
Quick Answer: How to Switch Administrator in CMD
To run Command Prompt as administrator in Windows 10, open Start, search for cmd, right-click Command Prompt, and select Run as administrator. When the User Account Control (UAC) prompt appears, select Yes.
To change a user account to an administrator from an elevated Command Prompt, use the following cmd command to become admin for that account:
net localgroup administrators "UserAccountName" /add
Replace UserAccountName with the username of the account you want to add to the local Administrators group.
It’s worth noting that this command does not bypass Windows security or turn a standard Command Prompt into an administrator session on its own. You need administrator privileges first before you can make this account-level change.
Before You Start: Administrator Access Is Required
Before you try to switch a user account to an administrator using CMD, there’s one requirement to understand: you need administrator access to make the change.
A standard Command Prompt does not automatically gain elevated privileges just because you enter an administrator-related command. Windows 10 protects these settings through User Account Control (UAC), so you need to open Command Prompt with Run as administrator and approve the UAC prompt before making any account-level changes.
Keep these points in mind before continuing:
- Administrator access is required — You must already have an administrator account, or the appropriate administrator credentials, to make changes to another user account.
- Standard CMD is not elevated — Opening Command Prompt normally does not give it administrator privileges. Commands that require elevation may fail with an Access is denied message.
- UAC approval may appear — When you choose Run as administrator, Windows 10 can display a User Account Control prompt. Select Yes to continue.
- The account and Command Prompt are separate — Opening an elevated Command Prompt gives the current CMD session higher privileges. It does not automatically change the Windows account itself.
- The CMD command does not bypass security — The
net localgroupcommand can add an account to the Administrators group, but it must be run from an already-elevated Command Prompt.
Once you have the required administrator access, you can use the methods below to open an elevated Command Prompt and make the necessary account changes.
How to Open Command Prompt as Administrator in Windows 10
With administrator access confirmed, the easiest way to get an elevated Command Prompt in Windows 10 is through Windows Search. Use this method whenever you need to run a command that requires higher privileges.
- Click the Start button or open Windows Search.
- Type cmd or Command Prompt in the search box.
- Make sure Command Prompt appears as the selected result.
- Right-click Command Prompt and select Run as administrator.
- When the User Account Control (UAC) prompt appears, click Yes.
Windows 10 opens an elevated Command Prompt window. Check the title bar for Administrator: Command Prompt to confirm the session has administrator privileges.
You can now run commands that require elevated permissions from this window. This is also the starting point when you need to use a CMD command to add an authorized user to the Administrators group.
Use the Run Box to Open an Elevated Command Prompt
If you prefer keyboard shortcuts, Windows 10 also lets you launch an administrator Command Prompt through the Run box. It takes only a few keystrokes and avoids navigating through the Start menu.
- Press Windows + R to open the Run dialog box.
- Type cmd in the text field.
- Instead of pressing Enter, press Ctrl + Shift + Enter.
- If Windows displays the User Account Control prompt, click Yes.
The elevated Command Prompt opens, allowing you to run commands with administrator permissions. Note the distinction: pressing Enter after typing cmd opens a normal Command Prompt, while Ctrl + Shift + Enter launches it with elevated privileges.
Open Command Prompt as Administrator from the Power User Menu
Windows 10 also includes a Power User menu, which provides another quick way to access administrative tools. You can open it from the Start button or with a keyboard shortcut.
- Press Windows + X on your keyboard, or right-click the Start button.
- Look through the Power User menu for Command Prompt (Admin).
- Select Command Prompt (Admin) to launch an elevated Command Prompt.
- When the UAC prompt appears, select Yes.
Depending on your Windows 10 version or configuration, you may see Windows PowerShell instead of Command Prompt in this menu. If that happens, you can still use the other methods in this guide to open CMD with administrator privileges.
Once the elevated window is open, you can proceed with administrative commands regardless of which method you used to launch it.
How to Change a User to Administrator Using CMD
Once you have an elevated Command Prompt open, you can use CMD to add an existing Windows 10 user account to the local Administrators group. This is the step you need when you’re specifically looking for how to switch administrator in CMD, or how to change a user’s role to administrator.
Before running the command, make sure you know the username of the account you want to change.
- Open Command Prompt as administrator using one of the methods above.
- Type the following command:
net localgroup administrators "UserAccountName" /add
- Replace
UserAccountNamewith the actual username of the Windows account you want to make an administrator. - Press Enter to run the command.
For example, if the account username is Alex, the command would look like this:
net localgroup administrators "Alex" /add
If the command completes successfully, Windows adds that account to the local Administrators group. The user can then receive administrator-level permissions after signing in again, where required.
Tip: If you’re not certain of the exact username, run
whoamito check the current signed-in account, ornet userto list every account on the machine. A mistyped username is one of the most common reasons this command appears not to work.
This is the main CMD command to become admin for an existing account, but it’s important to remember that the command must be executed from an elevated Command Prompt. A standard CMD window cannot use it to bypass Windows’ permission controls.
How to Check Whether the User Is an Administrator
After adding the account to the Administrators group, you may want to verify that the change was successful. Windows 10 provides built-in commands that can help you check the account’s group membership.
One straightforward option is the net localgroup administrators command:
- Open Command Prompt.
- Run:
net localgroup administrators
- Press Enter.
Windows displays the members of the local Administrators group. Look for the username you added earlier — if it appears in the list, the account has been added to that group.
You can also use:
whoami /groups
This displays the groups associated with the current Windows account. When checking administrator access, keep in mind that group membership and an elevated CMD session are not exactly the same thing. A user can belong to the Administrators group while an ordinary Command Prompt window is still running without elevation.
How to Run a Command as Administrator in Windows 10
If a particular command requires administrator privileges, you don’t need to make the command itself an administrator command. Instead, open Command Prompt with elevated privileges first, then run the command inside that window.
- Open Command Prompt as administrator using Windows Search, the Run box, or the Power User menu.
- Approve the UAC prompt by selecting Yes.
- Enter the command you need to run.
- Press Enter.
An elevated Command Prompt can run both ordinary commands and commands that require administrator permissions. The key is making sure the CMD window was launched with elevation before you execute the command.
For example, if Windows requires administrator access for a particular command, running it from a normal CMD window may result in an Access is denied message. Opening an elevated session first provides the permissions required for that operation.
So, when you ask how to run a command as administrator on Windows 10, the practical answer is to run Command Prompt as administrator first, then enter the command. This distinction also prevents confusion between opening CMD with elevated privileges and changing a Windows user account to an administrator.
What to Do If “Access Is Denied” Appears
If Windows 10 shows Access is denied after you enter a command, the issue is usually related to permissions rather than the command itself. Before changing anything else, check the following:
- Make sure Command Prompt is elevated — Close the current window and reopen it with Run as administrator. Approve the UAC prompt when asked.
- Check the account you’re using — You need access to an administrator account to make changes to user accounts or run commands that require elevation.
- Verify the username — When using
net localgroup administrators "UserAccountName" /add, make sure the username matches the account you intend to modify. - Check the command syntax — Even a small spelling or quotation-mark mistake can prevent CMD from completing the operation correctly.
- Run the command again — After correcting the issue, execute the command from the elevated Command Prompt.
If the problem continues, the account may not have the permissions required to perform the requested operation. In that case, an existing administrator should make the change.
Important Things to Know Before Changing a User to Administrator
Changing a standard user account to an administrator account gives that account broader control over the Windows 10 computer. That can be useful when the user needs to install software, change system settings, or perform administrative tasks, but it also increases the level of access available to that account.
Keep these points in mind:
- Use administrator access only when needed — Giving every account administrative privileges is not always necessary for everyday use.
- Be careful on shared computers — On a shared PC, changing a standard account to administrator can give that user access to settings and actions you may want to restrict.
- Use the correct account name — Double-check the username before running the
net localgroupcommand so you do not modify the wrong account. - Do not confuse elevation with account type — Opening CMD as administrator elevates that particular Command Prompt session. It does not automatically change the underlying Windows account to an administrator.
- You can reverse the change later — An administrator can remove a user from the local Administrators group when elevated access is no longer required.
Frequently Asked Questions
Is there a way to elevate an existing Command Prompt window, similar to Linux’s “sudo” command? No. Windows 10 does not have a built-in equivalent to sudo that lets you elevate an already-open Command Prompt window from within that same session. Once a standard Command Prompt is running, you can’t switch it to administrator mode from the command line. Instead, you need to close it and open a new elevated session using Run as administrator, the Run box shortcut, or the Power User menu, as covered earlier in this guide.
What’s the fastest keyboard shortcut to run CMD as an administrator without using a mouse? The Run box method is the quickest. Press Windows + R, type cmd, and instead of pressing Enter, press Ctrl + Shift + Enter. Approve the UAC prompt, and Command Prompt opens with administrator privileges.
Why do I still have to select “Run as Administrator” if my account is already an Administrator? Even administrator accounts run most applications, including Command Prompt, with standard-level permissions by default. This is how User Account Control (UAC) works in Windows 10 — it limits everyday actions to reduce the risk of unintended system changes. Selecting Run as administrator and approving the UAC prompt is what actually elevates that specific session, regardless of your account type.
I spend a lot of time in Command Prompt. Is there a way to make it always open as administrator? Yes. Right-click your Command Prompt shortcut, select Properties, click the Advanced button on the Shortcut tab, and check Run as administrator. Saving this setting means that shortcut will always launch Command Prompt elevated, so you won’t need to right-click and select Run as administrator every time. Windows will still show the UAC prompt for approval.
I’m pressing “Windows + S” to open the Run box, but it’s just opening Search. What am I doing wrong? That’s expected behavior — Windows + S opens Windows Search, not the Run box. The correct shortcut mentioned in this guide is Windows + R. From there, typing cmd and pressing Ctrl + Shift + Enter opens Command Prompt with administrator privileges.
Conclusion
Windows 10 gives you several ways to open an elevated Command Prompt, including Windows Search, the Run box, and the Power User menu. Once CMD is running with administrator privileges, you can execute commands that require elevated access.
When the goal is to change a user account, the net localgroup administrators "UserAccountName" /add command provides a direct way to add an authorized account to the local Administrators group. The key is to remember the difference between running CMD as administrator and changing a user’s account privileges.
With the right administrator access and the correct command, you can handle both tasks directly from Command Prompt without unnecessary steps. If you run into a different error along the way, let us know in the comments.
Discover more from Izoate
Subscribe to get the latest posts sent to your email.
