by Barry Dysert
(last updated August 29, 2016)
Have you ever been in a folder in File Explorer and wanted to bring up the command prompt at that same location? (Working with the command prompt can be found in other WindowsTips.) Or perhaps you're already at the command prompt level and want to bring up File Explorer at your default directory. Both of these things can be done quite easily.
Let's take the first case. Say you're in File Explorer and looking at the files in a folder called C:\Users\Barry.Dysert\Documents\Personal\Tips.Net. You want to do some things with the files in that folder that could be more easily done from the command prompt level. Instead of bringing up a command window and typing that long directory string, you can accomplish your goal simply by clicking in the address bar of File Explorer and typing (without quotes) "cmd .". (That's the string "cmd" followed by a period.) Immediately upon pressing Enter a command window appears, and its default directory is set to C:\Users\Barry.Dysert\Documents\Personal\Tips.Net. Now you can do your command-level work and close the window when you're finished.
In the second case, you're already in a command window, and your default directory is set to someplace long—say, C:\Users\Barry.Dysert\Documents\Personal\Tips.Net. In this case, you want to invoke File Explorer and have it set to that same folder. Easy enough; at the command prompt type:
C:\Users\Barry.Dysert\Documents\Personal\Tips.Net> Explorer .
(That is, type the word "Explorer", follow it with a period, and press Enter.)
Immediately, File Explorer launches, and it is pointing to your Tips.Net folder. Now you can work in File Explorer and close the window when you're finished.
This tip (13461) applies to Windows 7, 8, and 10.
You may have the need to perform repetitive operations or group several commands together to run as a batch. In such ...Discover More
Finding data within files is a common need. If what you're looking for is in a flat file, you can find what you're after ...Discover More
A niche command that sometimes comes in handy is the FOR loop. It has several forms and therefore can serve several ...Discover More
FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."