How to add Command Prompt (admin) to File Explorer context menu on Windows 11

  • To add the option to open Command Prompt (admin) from File Explorer, create the

    runas

    key, set the default string as

    Command Prompt (Admin),

    create the

    NoWorkingDirectory

    and

    HasLUAShield

    strings, create and set the

    Position

    string to

    Top,

    create and set the

    Icon

    string to

    C:\\Windows\\System32\\cmd.exe.

    And create the

    command

    key and set the default string to

    cmd.exe /s /k pushd \ %V\

    then restart the computer.

You can open the File Explorer path in the Command Prompt by right-clicking inside a folder on Windows 11, but there isn’t an option to launch the console as an administrator.

However, you can add an entry to the classic context menu using the Registry if you need to execute an application that requires you to enter a specific folder location in File Explorer with Command Prompt as an administrator.

This tutorial will show you how to add a new entry in the File Explorer (traditional) context menu so that you can access a certain path in the Command Prompt on Windows 11 (or Windows 10) as an administrator.

Add Command Prompt (admin) to context menu on File Explorer

In Windows 11, follow these steps to launch Command Prompt as an administrator from the File Explorer context menu:

Launch Windows 11.

To launch the app, search for “regedit” and select the top result.

Proceed to the following route:

Choose theKeyoption after right-clicking the shell key (folder), then selecting New.

Shell create runas key

Press Enter after naming the key “runas.”

Choose the runaskey.

To change the default string’s value to Command Prompt (Admin), double-click on it.

Change default string value

Press the “OK” button.

Choose the String Value option after right-clicking the runas key (folder), then selecting New.

Create NoWorkingDirectory string

Press Enter after naming the key NoWorkingDirectory.

Choose the String Value option after right-clicking the runas key (folder), then selecting New.

Press Enter after naming the key “HasLUAShield.”

Choose the String Value option after right-clicking the runas key (folder), then selecting New.

Press Enter after naming the key Position.

Change the value of the newly generated key to Top by double-clicking on it.

runas top

Press the “OK” button.

Choose the String Value option by right-clicking the runas key (folder), then selecting New.

After naming the key icon, hit Enter.

Change the value of the newly generated key to C:\\Windows\\System32\\cmd.exe by double-clicking on it.

Path to Command Prompt icon

Press the “OK” button.

To access the Key option, right-click the runas key (folder), select New, and then pick theKey option.

After naming the key command, hit Enter.

Create NoWorkingDirectory string

To set the value of the Defaultstring, double-click it and type cmd.exe /s /k pushd \”%V\”.

Context menu Command Prompt admin entry

Press the “OK” button.

Restart the computer.

To open the path in Command Prompt (admin), but with the admin console on Windows 11, use the Shift + F10 keyboard shortcut or right-click inside a folder and select the Show more options item to open the classiccontext menu.

Leave a Comment