Running Command Prompt (cmd) with administrative privileges directly from a specific folder in File Explorer is a quick way to execute commands with elevated permissions within that location.
Here is the direct method to run cmd
as administrator from File Explorer:
Method 1: Using the Address Bar
This is the most straightforward method highlighted in the reference.
- Open File Explorer: Navigate to the folder where you want to open Command Prompt.
- Go to the Address Bar: Click on the address bar at the top of the File Explorer window. The current path will be highlighted.
- Type
cmd
: Delete the current path in the address bar and typecmd
. - Press CTRL+SHIFT+ENTER: Instead of just pressing Enter, press CTRL+SHIFT+ENTER.
By pressing CTRL+SHIFT+ENTER, Windows will prompt you with a User Account Control (UAC) dialog asking for permission to run the Command Prompt as an administrator. Confirm the prompt, and a Command Prompt window will open with administrative privileges, with the current directory set to the folder you were in when you typed cmd
in File Explorer.
- Benefit: Opens
cmd
directly in the desired folder with admin rights. - Requirement: Requires confirming the UAC prompt.
Method 2: Navigating via Command Prompt First (Alternative)
While not running cmd from File Explorer in the same way, the reference mentions an alternative approach:
- Open Command Prompt normally (you can open it as administrator initially if needed, though this method doesn't require it to start).
- Use the
cd
command to navigate to the desired folder path. For example,cd C:\Users\YourUsername\Documents
. - Once you are in the desired directory in Command Prompt, type
start .
and press Enter.
This start .
command will open a new File Explorer window displaying the current directory you were in within the Command Prompt. This is more about using Command Prompt to open File Explorer in a specific location rather than the other way around for running cmd
as admin.
Summary Table:
Method | Action in File Explorer | Command/Keys | Result |
---|---|---|---|
Using Address Bar | Type cmd in address bar |
CTRL+SHIFT+ENTER | Opens Admin CMD in current folder (via UAC) |
Navigating via CMD | (Doesn't open CMD from Explorer) | cd <path> , start . |
Opens File Explorer in current CMD folder |
For the specific task of launching an administrator Command Prompt from a particular folder location already open in File Explorer, the address bar method using CTRL+SHIFT+ENTER is the most direct technique, as detailed in the provided reference.