Windows optimize

How do I tweak Windows Explorer to open in a directory of my choosing?

Mark Kaelin shows you one tweak he uses all the time to help him get where he is going inside Microsoft Windows XP.

In information technology and operating system terms, Microsoft Windows XP has been around a very long time. Over the years, TechRepublic has literally written thousands of tips, tweaks, tricks, and hacks in our article, download, and blog pages. One of my favorites is a quick and easy tweak that will change the behavior of Windows Explorer.

The directory/folder metaphor employed by Windows XP to organize files on a hard drive fits well with my natural tendency of hierarchical organization. My thinking pattern follows the general > less general > specific > most specific framework. So there are times when I want to see a particular folder hierarchy laid out before me in Windows Explorer.

This blog post is also available in PDF format in a TechRepublic download. This blog post was originally published on December 3, 2008, but several members have been asking for the information so I am reprising it.

Tweak the displayed folder

The default display for Windows XP Explorer is to show the My Documents folder with all of its subfolders expanded and ready to be selected (Figure A).

Figure A

The default Windows XP Explorer view

There is nothing wrong with this view, but I don't always want to open Windows Explorer in the My Documents folder. I have access to, and the need to use, several different network folders during the course of a day. With a small tweak of the Windows Explorer Properties settings you can change which folder gets displayed and how that display is revealed.

To get to the Windows Explorer Properties dialog box, right-click the Windows Explorer shortcut. You can copy the shortcut in the Start Menu to your Desktop to make it easier to work with. I like to have several Windows Explorer shortcuts in my toolbar for easy access -- each going to a different place.

When you right-click and go to Properties and click the Shortcut tab, you should see a screen similar to Figure B.

Figure B

The Windows Explorer Properties dialog box

The key box is the Target box. To change the Windows Explorer shortcut to open a specific folder of your choosing, change the Target box to read:

c:\windows\EXPLORER.EXE /n, /e, X:\Folder of my choosing

For example, the blog posts I write or edit are saved on a network drive (U) in a folder I have dubbed "Working Folder." The Target box for this shortcut looks like this and the corresponding screenshot is shown in Figure C.

c:\windows\EXPLORER.EXE /n, /e, u:\working folder

Figure C

A new target folder
Now, when I click this Windows Explorer shortcut, I get the screen shown in Figure D.

Figure D

My working folder

Additional tweak

The tweak above shows my Working Folder and all the subfolders under it. But with a small additional tweak, I can get a Windows Explorer view that shows the Working Folder subfolders collapsed (Figure E).

Figure E

Working Folder with subfolders collapsed

This is a cleaner more concise look. To get this behavior, add the /select command to the Target box like this:

c:\windows\EXPLORER.EXE /n, /e, /select, u:\working folder

Your choice

You can apply this tweak to as many folders as you want. You can give them different icons and place them on your desktop or on your toolbar. This small tweak gives you great flexibility in how you interact with Windows XP.

Someone asked

In the attached discussion thread, there was a request for an explanation of the Windows Explorer in-line commands. I found a reference on Microsoft's Help and Support pages:

  • /n: Opens a new window in single-paned (My Computer) view for each item selected, even if the new window duplicates a window that is already open.
  • /e: Uses Windows Explorer view. Windows Explorer view is most similar to File Manager in Windows version 3.x. Note that the default view is Open view.
  • /root: Specifies the root level of the specified view. The default is to use the normal namespace root (the desktop). Whatever is specified is the root for the display.
  • /select: Specifies the folder to receive the initial focus. If /select is used, the parent folder is opened and the specified object is selected.

Stay on top of the latest XP tips and tricks with TechRepublic's Windows XP newsletter, delivered every Thursday. Automatically sign up today!

About

Mark Kaelin is a CBS Interactive Senior Editor for TechRepublic. He is the host for the Microsoft Windows and Office blog, the Google in the Enterprise blog, the Five Apps blog and the Big Data Analytics blog.

131 comments
djthomas
djthomas

Does this work for Windows 7?

vickywww
vickywww

try dsl-speed, a professional tool that will online optimize and speed up your DSL(e.g.,ADSL,G.lite,IDSL,SDSL)connection

ndosalak
ndosalak

since my PC got virus (now was clean) I can't open(with doubleclick) Removable Disk from "My Computer" folder. How to fix it?

wongeun18
wongeun18

I like short cut for opening the window explorer, Your Tip can't not work when I use (window key+ E)key. How can I solve this problem.

total17
total17

Great article and very helpful. Thanks

Will_B
Will_B

I admit I didn't ready the blog comments. However, I have XP installed, and do this approach all the time. Just set the taget to the Folder you wish to open. Therefore Taget = "N:\DevSupp\Appworx" When you double click on the explorer icon, it opens to that directroy.

DLWilson
DLWilson

I Love this one. I have been so tired of worming my way through directories and files to get where I want to be. I now have the means of going directly 90% of the time. And you know what, it even works on VISTA. I do have one of those things in the house (2 XP's & 1 VISTA). So thanks for this tweak it has been really helpful. DLWilson

scotty37
scotty37

Sorry if this was mentioned above as I haven't read everyone's responses. Wouldn't it be easier to right click on any folder or file of choice and select "send to" "desktop (create shortcut)" ? Ok I know that wont show the file tree unless you click the "back" button a few times, I often do this especially on mass storage drives at home (like 10 years worth of files) as it saves so much time remembering and searching where that important folder/file is at the time.

pedro52
pedro52

Is there a way to do this with Vista? I haven't tried all options listed here but a couple that are listed here that I had in my own reference book don't work. Thanks

scansite
scansite

Hi Mark, Thanks for this practical tip. What annoys me, is that when I do File Open, the folder view is never Details. Can you tweak XP, so that it shows the Details View? Thanks in advance for your feedback. Regards, Carl / Amsterdam / Holland

ashamess
ashamess

Great Post, Mark !! I'll be using it a lot !!

saaiebabak
saaiebabak

An excellent selfless free service to computer users. Many thanks. Dr. KB Saaie

sgivens
sgivens

Nice tip. I am curious what the /n flag does on the command line though. I'm not seeing a difference when I try it with and without. Where do I find more info on Explorer command options? "Explorer /?" didn't work. thx

John J.
John J.

This is an interesting tip and it works fine. But why bother? I just create shortcuts to the drives and folders I want to explor, name the shortcut descriptively (H JAJ takes me to - you guessed it - H:\JAJ) then drag them into the system tray. They've got the same folder icon as Windows Explorer. When I click it opens Explorer into the folder of my choice. Same result - yes?

Chipv
Chipv

Where did you find the command switches for Explorer??

RCS
RCS

Can't you just save a shortcut on the desktop to the folder and rename it? To access the explorter just click on "FOLDERS" This also lets you set icons on the desktop item to allow you to differentiate the folders.

Kamuela
Kamuela

Great tweak... Check out figure c, it depicts the m:/working folder instead of the u:/working folder called for in the example.

mailparikshit@yahoo.com
mailparikshit@yahoo.com

To get explorer without folder browser/folder tree c:\windows\EXPLORER.EXE /n, /select, u:\working folder

SJ5
SJ5

Quick and Easy. Thanks

AstroCreep
AstroCreep

Anyone know how to get the Windows Explorer default 'directory' to be the root of the "My Computer" applet?

NickNielsen
NickNielsen

Windows Explorer will always open in "My Computer" when you use the Windows+E keyboard shortcut. I believe MS has hard-coded it into Windows and you can't change it without hacking the OS.

alainch
alainch

I always use a different partition for the System Indeed I have 2 twin System partitions for each PC: D:\Sys1 E:\Sys2 If the main one stop to work, just reboot and choose the other. The user loose may be 5 minutes and you dont have to run to repair. 2nd goody it's easy to repair the other system from a working system on the machine Easy to defrag (the other SYS partition) easy to restore or format. Problem is that all users save in "My Documents" and this under the SYS# partition!!! So the system get reframmengted easily, and the space not optimized. Now I Moved and redirected all "My Documents" folders to F:\users\%user%\My Document Each user open by a shortcut his own folder ... World ecc.. use it as well END OF TROUBLES !!! a BIG thanks for those TWO tips I'm late but AlainCh ( Gratefull

NickNielsen
NickNielsen

Your method (on my machine - WinXP SP3) only opens the single file listing pane. I prefer to work with both the file list and the directory tree visible. Habit, I suppose.

cknox
cknox

Interesting article (and thread...) One of my most used commands is WinKey e ? you can use it multiple times to create more windows(also Winkey r is handy at times.)

seanferd
seanferd

find "Command-Line Switches for Windows Explorer" in Help for your options. Make sure you aren't putting any spaces in the command where they don't belong. #1 cause of failure with command switches.

oddacorn
oddacorn

Carl, You can set your default view for folders in Windows Explorer using the Tools-Folder options menu. On the view tab of the dialog this launches, you'll find a button at the top that allows you to apply the current view to all folders. If you first set up Explorer to show the details view, you can make that your default. Since different views make sense for certain folders, such as those for images, I would recommend checking the "Remember each folder's view settings" option in the "Advanced settings" section of this same dialog (this setting is normally on anyway, so you probably just need to verify). This will allow you to override the details view on specific folders after you apply it to all of them. Personally, I like to make a few modifications to the column order and column widths of the details view before I apply it. I always drag the "Date Modified" column over into the second position, since that's information that's more useful than the "File Type", which I usually know from the extension. I put "Size" third. On some systems I also display the "Attributes" column so I can see at a glance what files are marked Read-Only. If you right-click any of the headings, you'll get a long list of other file properties that you can display by checking them. Now the real question is, "What the heck is a 'Muxer'?" Regards, Todd Corson P.S. If you're looking at some files in Windows Explorer and the column widths are off (either too wide or too narrow), just press [Ctrl] and the [+] key from the numeric keypad and all columns will be instantly resized to fit their content! This trick has been around since Windows 95, I believe, but hardly anybody knows about it.

Mark W. Kaelin
Mark W. Kaelin

I added the command explanations to the blog post.

oddacorn
oddacorn

Steve, The /n parameter ensures that a new Explorer window is opened. Without this parameter, it's possible that an existing Explorer window might be reactivated or hijacked instead. In my experience, you don't need the /n when you're using /e. Regards, Todd Corson

seanferd
seanferd

"Windows explorer command line switches".

ssency
ssency

The change worked on the properties of Explorer in the Programs Accessories group -- but the right click on Start to access Explorer has the old settings.

Mark W. Kaelin
Mark W. Kaelin

You have a good eye my friend. I admit it - I got my drive letters mixed up. The folder I was looking for was on U not M, but I took the screenshot before I realized my error.

jerry.runnels
jerry.runnels

This works on my system. %systemroot%\explorer.exe /e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}

LPCollector
LPCollector

The solutions posted already are all about modifying the windows explorer shortcut icon (right click) - Properties - Target = %SystemRoot%\explorer.exe /n, /e, C:\ This solution works for the: 1. Right Click "Start" Button, choose "Explore" and 2. Windows Key + E Run -- regedit My Computer HKEY_CLASSES_ROOT Folder shell explore ddeexec (Default) (in right pane) > double-click (OR) right-click, Modifiy OLD: [ExploreFolder("%I", %I, %S)] NEW: [ExploreFolder("C:\", C:\, %S)] Hope this helps. I dug in the internet a few years ago and found it. Forgot where. Chris

seanferd
seanferd

Would it make a difference to this method whether the file association for folders is set to explore rather than open as default?

pedro52
pedro52

Thanks for the tip, I found it at the MS site using the "search the net" option. The answer to opening win explorer to C drive is to go to Properties after right clicking your shortcut to Explorer, in the command window, put a space after the command and type in /n,/e,C:\ It will now open at C drive regards pedro

pedro52
pedro52

Thanks for the tip, I found it at the MS site using the "search the net" option. The answer is to go to Properties after right clicking your shortcut to Explorer, in the command window, put a space after the command and type in /n,/e,C:\ It will now open at C drive regards pedro

Glenn from Iowa
Glenn from Iowa

If you just want to resize individual columns, you can double-click on the line at the top between the column headings. The mouse pointer will change to a double-headed arrow (pointing left-right). When you double-click then it will resize the column to the longest entry in that column only.

scansite
scansite

Thanks for your feedback Todd, My question was whether you can also tweak XP to show the Details View when you are in Word, for example, and choose File > Open. A Muxer is a Multiplexer. You will often see the name abbreviated to "Mux". Multiplexing is combining a number of separate electrical signals onto a copper or fiber cable. Separating these signals at the end of the line is called "demultiplexing". Regards, Carl.

seanferd
seanferd

Exploring the start button will always lead to the folders it displays. It is just like navigating to your C:\Documents and Settings\%username%\Start Menu then right-clicking and choosing Explore.

PrinceGaz
PrinceGaz

This is my usual Windows Explorer shortcut so that it opens at the root of the C drive (it should be pretty obvious what to change if you want it top open anywhere else). I do use the traditional two-pane view, with folders on the left and contents on the right. %SystemRoot%\explorer.exe /e,c:\

oddacorn
oddacorn

Here's a slightly simpler method that's easier to remember: explorer /select, C: Of course you can put whatever drive letter you want to be highlighted by default. Todd Corson Houston, TX

Chug
Chug

Here's another way that's a little eaiser to remember. Has a slightly different result but works for me. explorer.exe /e,/select,c:\ Jerry's suggestion will open with "My Computer" selected in the directory tree in the left pane. My command above opens the exact same view but has the C:\ drive selected in the right pane. Either command works, mine just may be a bit easier to remember than that big long GUID, as long as you don't mind having the C:\ drive selected in the right pane by default.

seanferd
seanferd

I never really use such shortcuts, or explorer.scf, except by having "my computer" in the quick launch.

NickNielsen
NickNielsen

My default folder action is explore and I still only get the file list.

oddacorn
oddacorn

Carl, I'm glad to hear this will help you. Interestingly, I just got the latest issue of PC World in the mail last night and found that they've given a shout-out to FileBox eXtender in an article entitled "Eight Fixes for Vista's Worst Features." It's spooky how the whole universe is connected, huh? I guess I should probably ask you if you know the one guy I know who's from Holland! Todd

scansite
scansite

Hi Todd, Thanks for getting bsack to me with this great piece of news! I'll definitely check it out today! That will solve a major headache. Thanks a lot. I've also read there is a utility for Office 2007 that brings back the normal menu structure of Word and Excel 2003, which frees us from having to use the asylum-quality ribbon. I've got the details at home, so if you need them, let me know. Thanks for pointing out FileBox eXtender, I appreciate it a lot. Regards, Carl / Amsterdam / Holland

oddacorn
oddacorn

Carl, I guess I didn't read your post carefully enough. If you're interested in switching your dialogs to details view, I would recommend downloading a utility called FileBox eXtender from hyperionics.com. It's an indispensable piece of freeware I've been using for years (though it wasn't always free). You can set it up to auto-switch file dialogs to details view and specify how to sort them as well. It'll also auto-resize dialogs to a specified percentage so you're not stuck with tiny little file browsers. Plus, you can set up shortcuts to frequently used folders that are accessible via a couple of extra buttons added to the title bar, both in File Dialogs and Explorer. Lots of other features, too - take a look! Regards, Todd

seanferd
seanferd

That should work for most apps that include the View setting in the dialog box. It is just that there are a couple of programs I use, for which I save or open files frequently, where the setting would not even persist per session. I'm sure apps from major vendors will have no problem in keeping that setting.

scansite
scansite

Thanks Sean, That's the answer I was looking for. I'll experiment with other Windows programs to find out whether the setting there is persistent too. Regards, Carl

seanferd
seanferd

The File open dialog box in Word is a function of Word, so no, there is no Explorer tweak universal to all dialog boxes opened by arbitrary applications. In Word, get the File Open dialog box. At the top is a view button which can be set to Details view. The view setting seems to be persistent in Word, but in some apps it is not, much to my annoyance, as scrolling sideways in blocks of files does not suit me as well as scrolling down smoothly. I mean, why have view settings if the don't persist? I think it may be that some programmers are using the generic code for the dialog box without making provisions for storing the settings.

dhays
dhays

still opens only the right hand side, you still have to click the folders icon to get the left side to be viewable

oddacorn
oddacorn

Chug, I guess I was interpreting the question as a command equivalent to double-clicking the "My Computer" icon on the desktop. I use the "/e" parameter on most of my browsing shortcuts, too (although mine are hotkey shortcuts in an AutoHotkeys script). For anyone else reading down this far, another useful command line parameter for explorer.exe is the "/root" parameter, which allows you to specify what should be shown as the "top level" directory in the tree view. I use this to get rid of a lot of the junk that's usually shown there when working in specific folders. As an example, I have a work folder on my F: drive, which is a flash drive, as well as lots of personal stuff like music, documents, etc. To help me keep focused at work, I use the following command to open up my work folder so I don't see all of those distractions: explorer.exe /e,/root,F:\Work The only minor problem with this feature is that pressing Ctrl+F to do a file search from an Explorer window launched this way will open a new Explorer window that searches local drives, not the currently selected directory. The new window is opened since the "Search Results" item is not available in the tree of the "re-rooted" Explorer. Hope someone finds this useful! Todd

Chug
Chug

That's a little different. If you leave off the /e you don't get the directory tree view on the left pane. I want the tree view so I have to use the /e.