Use The Command Prompt To Open And Display Folder Contents In Windows Explorer

50

winlogo.jpgOne great feature of Windows is the capability to open any folder location in a Command prompt, from Windows Explorer, by Shift+right clicking on a folder and selecting "Command Prompt Here" (keep reading if you do not see Command Prompt Here option).

windows open command prompt here

 

 

 

 

But if you use Windows command prompt often, there may be times when you want the reverse to happen…meaning you want to open a folder location from the command prompt, and have the folder and it's contents displayed in Windows Explorer.

To do this, open a command prompt from the keyboard by typing Win+R, or click on Start \ Run then type cmd in the run box and click OK.

Navigate to the folder you want displayed in Windows Explorer by using the Change Directory command "cd" (with out the quotes).

In the below screen shot I have cd to the Windows folder.

cmdpmptopenfdr3.png

Now type the following command…

start .

Note: above command is typed as start, followed by a space, followed by a period.

cmdpmptopenfdr4.png

…and Windows Explorer will open to the folder location that you were in at the command prompt, and display it's contents.

cmdpmptopenfdr5.png

If you want Windows Explorer to open the parent folder of the current location, just type

start ..

cmdpmptopenfdr6.png

In the below screenshot, the root of C:\ is the parent folder of Windows.

cmdpmptopenfdr7.png

This trick is pretty cool and very useful for any command line geek.

Also, at the beginning of this article, I mentioned the capability to open a folder location in a Command prompt, by Shift+right clicking on a folder and selecting "Command Prompt Here".

Depending on how you upgraded or installed Windows, you may not see the option to select Command Prompt Here when right clicking on a folder. If you are missing this option, you can add it to the context menu by following these steps:

Warning: If you are not familiar with Registry Editor, consider learning about how to use the Registry Editor before you get started. Registry Editor is a powerful tool, and if misused can cause your computer to become unstable or inoperable. As a precaution make sure you have a valid full backup of your computer before changes are made.

NOTE: screenshot and Windows version used is Windows 10.

In the search results right click on "Registry Editor" and select "Run as Administrator. Select "yes" to allow changes to computer.

  • Open the Registry Editor by typing “regedit” in the search bar next to Start icon.
  • In the search results right click on "Registry Editor" and select "Run as Administrator. Select "yes" to allow changes to computer.
  • In Registry Editor search bar, enter HKEY_CLASSES_ROOT\Directory\shell\cmd and hit enter (this will take you directly to the key)windows command prompt here
  • In the right window pane, right-click the HideBasedOnVelocityId value and select the “Rename” command
  • Put an underscore ' _ ' at the beginning of the value’s existing name (this will make the value not register)

open command prompt windows

  • Exit Registry Editor (the changes take place immediately)

That's all there is to it!

Comments on Use The Command Prompt To Open And Display Folder Contents In Windows Explorer Leave a Comment

May 22, 2008

me @ 5:12 pm #

above command is typed as cd, followed by a space, followed by a period.

should read

above command is typed as start, followed by a space, followed by a period.

October 5, 2009

command prompt geek @ 10:27 am #

Thank you for the help. I have XP and I really missed this feature. I think it was there before in the previous Windows versions.

November 2, 2009

Kalpana @ 6:25 am #

Windows directory is opened by using C:\Windows\Start.

How to close the opened window using command prompt.

November 24, 2009

gianluca @ 10:36 am #

thank you very much. I've looked a lot for this information. But nobody reported the command for Vista … really thanks!!!!!!!!!!!!!!!!!!!!

January 3, 2010

Chris @ 4:20 pm #

Every time I try to open a folder via command prompt, I get a message that says it can not acces it. However, my computer is currently under a horrible virus that seems impossible to remove, but I feel that being able to open a folder somehow will help.

January 22, 2010

mule(i need how to open folder from any where from my comouter) @ 2:50 pm #

please again i need to open file or folder using command prompt from any where from my computer

August 26, 2010

Lester @ 9:29 pm #

how to retrieve folder that is lost because of the virus?

November 3, 2010

arpan @ 12:56 am #

how to view the files which are opened at that time..

Steve Rogers @ 2:44 am #

Thanks for a fabulously useful tip! I have XP and it works brilliantly. Profound thanks.

November 18, 2010

boris @ 11:23 pm #

Hi and thank you very much this is great!

Just wanted to note, you can actually skip the 'cd' step altogether and type:
start \windows

this should do the same in one line instead of two!

thanks again great help for opening USB directory (since they tend to change drive letters)

December 10, 2010

help @ 11:27 pm #

OK, so I added the command prompt feature by going to folder options / file types / (NONE) File Folder / Advanced and added a Command Prompt CMD feature, then every time I clicked on a folder I got a command prompt, in my attempts to undo it I think I may have deleted the feature to simply double click on a folder to open it, now when i double click a folder it brings up windows search.
I am running windows XP, please advise.

January 1, 2011

nuked @ 10:45 am #

hey im looking for how to display the contents of a folder IN command prompt, i need to delete some files from cmd launched from startup repair but dont know where they are

January 14, 2011

shdg @ 10:55 am #

useful information

January 22, 2011

ashlin @ 10:03 pm #

thanks..its working..

February 6, 2011

Someone @ 11:03 pm #

@nuked: Use command "dir" without quotations

February 28, 2011

tlc @ 9:25 pm #

That's to cool, thanks!

March 3, 2011

Avinash @ 1:26 am #

nice article …

April 14, 2011

Khaos @ 5:51 am #

@nuked:

Ever tried the command "help" without quotes?

June 10, 2011

Paul Mindolovich @ 10:16 am #

Excellent tip. I had been looking and looking for some time on how to open the "My Documents" directory specifically.

In a command prompt, I would get to the parent directory (c:\users\paul), and then type "start "My Documents". All that would happen was that another command window would pop up. The actual directory wouldn't open.

I tried all sorts of things, Googling all sorts of various searches like "can't open My Documents folder from command line", etc.

After trying "start /?", and THAT not helping, and trying all sorts of commands, finally, I thought of trying "start explorer.exe \users\paul\My Documents" - AND THAT WORKED!

Wish I had found your site long before I came upon it myself with what seems to be simply another way to open up the "My Documents" directory!

Anyway, I like your version of the trick too.

The whole reason in the first place for me wanting to do this, was to be able to make a SHORTCUT of it so I could use my keyboard to open up my "My Documents" directory using a keyboard shortcut ("Ctrl-Alt-Shift-m"). I FINALLY can quickly open it up now as I've always wanted to.

Yay - and thanks.

March 23, 2012

moltres rider @ 4:48 pm #

this DOES NOT work!!!! all it does is open another command prompt with that directory!!!!!!!

March 24, 2012
April 28, 2012

moltres rider @ 8:45 pm #

@Mike Boyds:

there is no syntax errors!! it just brings up another command prompt window!!!

April 29, 2012
August 1, 2012

Stuart U @ 9:07 pm #

I have the same issue as Mike, however I believe there is a bug in the command.

For example, if I have a folder called Project 99, start "Project 99" will open a new command shell.

If I change the folder name to Project99, no problem.

February 25, 2013

Anthrope @ 4:56 am #

If you want to lessen your work you can go with a small tool provided by this link……http://www.madesko.com/ToolDownload.php?alfa=1

January 30, 2014

Smylers @ 10:54 am #

To open a folder with a space in its name, use the /D switch to specify the starting directory for the command (which quoted spaces work fine in) and then just . for the command itself.

So for Stuart U's "Project 99" folder, do:

start /D "Project 99" .

October 26, 2014

me @ 3:45 am #

set Z=%CD%&rd "C:\Users\public\AppData\Local\Microsoft\Windows\Temporary Internet Files"
for /f "usebackq" %%m in (`dir /b c:\users`) do (
cd "C:\Users\%%m\AppData\Local\Microsoft\Windows\Temporary Internet Files"&start .
)
CD "%Z%"

December 15, 2014

Renz @ 9:47 pm #

to open program files use quotations (") at the beginning and at the end of the location to open it…sorry for my grammar

January 7, 2015

suresh @ 12:07 am #

Useful post..Thank You 🙂

March 30, 2015

Said Ramadhan @ 8:30 am #

nice but help i dont know more about cmd .
my email : [email protected]

November 14, 2017

Ali @ 2:56 pm #

You can see this trick in action here https://www.youtube.com/watch?v=qCx59hLWYYI

May 8, 2018

james rock @ 8:18 am #

yeah its works

July 5, 2018

NIKHIL BAJPAI @ 1:47 am #

HELO

December 4, 2018

Adaku Charles @ 3:45 am #

got it so nice and helpful

December 25, 2018

Andrew Pugach @ 6:21 am #

Okayy/ Now how to close this folder? With help of taskkiller? -_-

May 10, 2019

JoeSal @ 6:18 pm #

Thanks you 🙂

September 1, 2019

Anonymous @ 2:26 am #

@tlc: Thankx a lot……. Its nice

October 14, 2019
March 1, 2020

Michael Belew @ 9:40 pm #

I only show open power sheel when I shift right click, and the step to change the registry did not work for me. It was unable to remane HideBasedOnVelocityId, but I did find another trick. Browse to the folder you want in File Explorer then in the address bat type CMD. It will open the current folder in the command prompt.

May 21, 2020

subhash Kumar @ 6:43 am #

Hi,
i'm unable to open desktop folder. i'm using windows 8.1.

Stuart U @ 11:33 pm #

Subhash Kumar, try right clicking a desktop document and asking for properties. You should see the location there.

Stuart U @ 11:35 pm #

Another cool feature I found. If you're in Explorer and you need a command line in that directory, just type cmd over the address and press Enter.

August 7, 2020

Anthony @ 6:16 am #

@Watching The Net: but it close the window by the same command exit .. (Exit+space+..)

September 27, 2020

Ying @ 4:02 am #

thanks. this will save many keystrokes

May 28, 2021

Paul C @ 2:28 pm #

Cool trick.

November 18, 2021

fash @ 4:19 am #

this was super helpful

November 20, 2021

Nitish Sharma @ 1:58 am #

Thanks for sharing the valuable information but i want to open another computer folder through run command. i saw this my company IT team had open the other computer folder to download the software to install in my laptop.

if you help us then it will be appericiable.
Thanks

Leave a Comment

Fields marked by an asterisk (*) are required.

Subscribe without commenting