Switching Between Command Line and File Explorer

by Barry Dysert
(last updated August 29, 2016)

16

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.

Author Bio

Barry Dysert

Barry has been a computer professional for over 30 years, working in different positions such as technical team leader, project manager, and software developer.  He is currently a senior software engineer with an emphasis on developing custom applications under Microsoft Windows. ...

MORE FROM BARRY

Deleting a Library

Deleting a library can be done with a couple of mouse clicks. And even though you delete the library, the folders and files ...

Discover More

Scheduling a Program to Run on a Schedule

If you have certain programs that you want to have run automatically, you can use Windows Task Scheduler to quickly set up ...

Discover More

Using Powercfg to Duplicate an Existing Power Scheme

The Powercfg utility allows you to control how power is used on your system. This tip shows you how to use the command-line ...

Discover More
More WindowsTips

Changing Font Size in a Command Prompt Window

If you work at the command level very much, you may want to change the fonts that are used. You can control what typefaces to ...

Discover More

Displaying All the Files in a Folder using the Command Prompt

Displaying all the files a folder contains is an easy task in Windows. One way you can display the files is using command ...

Discover More

Renaming Files Using the Command Line

The rename command can really be a timesaver over trying to do the similar sort of thing with Windows Explorer. You can ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is five more than 2?

2016-08-31 16:46:26

David H.

Does this run the Cmd Prompt as an administrator? Whenever I use the Cmd. Prompt I do so as an administrator. Perhaps if File Explorer is opened as an administrator it will open the Cmd. Prompt as an administrator? When looking at the Cmd. Prompt how can one tell if it's running as an administrator? Thanks and this is a great tip!


2016-08-31 09:09:04

Mike Walz

Thanks, Charles


2016-08-30 17:21:47

Barry

Thank you very much for all your kind words. I only wish I could think of some more tips to post. I think I've pretty well tapped out most of the goodies I know about.


2016-08-30 09:54:18

Thomas Redd

This is unbelievably simple! Thanks for this marvelous tip! Where have I been all my life? Why did I not know about this sooner? I absolutely LOVE your tips! Thanks for all you do.


2016-08-30 07:05:58

Shreepad S M Gandhi

Thanks Barry.
Once again, got to know about this for the first time. In my case (Windows 7 enterprise) launching the command prompt was achieved just by typing cmd followed by Enter. No period or space required. However, launching Windows Explorer was achieved only by Explorer followed by a space and a period. Absence of space and period didn't achieve the desired result.


2016-08-29 19:17:18

Craig Small

Really useful tip - thanks!

It seems that cmd. or cmd . works just as well in Windows 7. It makes sense that the space is needed from the command line - the "." is a parameter to "Explorer"!


2016-08-29 14:22:11

John

Great tip! For years I've been achieving equivalent functionality with three additional keystrokes:

Explorer %CD%

So Explorer .

Will save me typing!

Thanks


2016-08-29 13:10:18

Steve Mackey

Cool Tip - thanks!


2016-08-29 12:39:11

Scott Renz

I love it.

I also saw the space between Explorer and the dot in your example with no problem.


2016-08-29 12:06:21

Gllenn Russell

It would have helped if you had pointed out that there should be a space before the period in each case. It's not real obvious (especially in the first case of going from Windows Explorer to command line).


2016-08-29 10:40:23

Rick Urquhart

Explorer. does not work in Windows 10
A space is needed:
Explorer .


2016-08-29 09:59:56

Mike Walz

I am a Windows 10 user and like the idea of being able to get a command window by typing cmd. I tried it and it works great. However, I could not get the Explorer command to work. Made sure the dot was there, tried explore and explorer, and also tried capitalizing, to no avail. Am I doing something wrong?

Mike


2016-08-29 09:53:01

Charles Ruffin

I found that "cmd." worked fine (once I figured out how to type in the address bar).
In the command window, when I tried "explorer." I found I needed "explorer .".
In other words, cmd no space period and explorer space period. Confusing to say the least.

Windows 10 ver 1607


2016-08-29 09:39:42

Cecil Britton

Thanks Barry. That is a very helpful one that I was unaware of. Will surely get use from me.


2016-08-29 09:08:08

Jennifer Thomas

Same problem as Faliq Isbah - I'm using Windows 7, in case that makes a difference.


2016-08-29 06:22:05

Faliq Isbah

When 'Cmd .' is executed, receive following message. Apparently Long folder names are not being supported. Any alternative for this beautiful tip?

"CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory."


Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.