One 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).
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.
Now type the following command…
start .
Note: above command is typed as start, followed by a space, followed by a period.
…and Windows Explorer will open to the folder location that you were in at the command prompt, and display it's contents.
If you want Windows Explorer to open the parent folder of the current location, just type
start ..
In the below screenshot, the root of C:\ is the parent folder of Windows.
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)
- 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)
- 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
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.
@me
OOPS! Nice catch. I have corrected the error.
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.
Windows directory is opened by using C:\Windows\Start.
How to close the opened window using command prompt.
@Kalpana
Typing "exit" (without the quotes) will close the prompt.
thank you very much. I've looked a lot for this information. But nobody reported the command for Vista … really thanks!!!!!!!!!!!!!!!!!!!!
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.
please again i need to open file or folder using command prompt from any where from my computer
how to retrieve folder that is lost because of the virus?
how to view the files which are opened at that time..
Thanks for a fabulously useful tip! I have XP and it works brilliantly. Profound thanks.
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)
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.
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
useful information
thanks..its working..
@nuked: Use command "dir" without quotations
That's to cool, thanks!
nice article …
@nuked:
Ever tried the command "help" without quotes?
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.
this DOES NOT work!!!! all it does is open another command prompt with that directory!!!!!!!
@moltres rider
No sure why it's not working for YOU. Make sure the command you are typing has no syntax errors.
@Mike Boyds:
there is no syntax errors!! it just brings up another command prompt window!!!
@moltres rider
It would be best if you post exactly what you are entering at the command prompt so we can see what's going on….
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.
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
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" .
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%"
to open program files use quotations (") at the beginning and at the end of the location to open it…sorry for my grammar
Useful post..Thank You 🙂
nice but help i dont know more about cmd .
my email : [email protected]
You can see this trick in action here https://www.youtube.com/watch?v=qCx59hLWYYI
yeah its works
HELO
got it so nice and helpful
Okayy/ Now how to close this folder? With help of taskkiller? -_-
Thanks you 🙂
@tlc: Thankx a lot……. Its nice
@mule(i need how to open folder from any where from my comouter): Jonny
@mule(i need how to open folder from any where from my comouter):
Jonny can help you
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.
Hi,
i'm unable to open desktop folder. i'm using windows 8.1.
Subhash Kumar, try right clicking a desktop document and asking for properties. You should see the location there.
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.
@Watching The Net: but it close the window by the same command exit .. (Exit+space+..)
thanks. this will save many keystrokes
Cool trick.
this was super helpful
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