Windows DevCenter    
 Published on Windows DevCenter (http://www.windowsdevcenter.com/)
 See this if you're having trouble printing code examples


Windows Explorer Hacks

by Mitch Tulloch, author of Windows Server Hacks
12/21/2004

Does anyone still remember File Manager, the file and folder management tool for Windows 3.1 and Windows for Workgroups? I still remember it with fondness and must have spent countless happy hours over the years creating hierarchies of folders to keep my business documents and personal files organized. Then came Windows Explorer, the new file management tool in Windows 95; despite the fact that nine years have elapsed since then, Windows Explorer (together with its alter ego, My Computer) is still the primary tool for managing files and folders on Windows platforms. Nine years without an upgrade--that must be a record, even for Microsoft!

So how can you get the most mileage out of a venerable old tool like Windows Explorer? It turns out there are a few tricks you can use to make managing files and folders faster, easier, and more efficient. Here are four of my favorite tips and tricks for getting the most out of Windows Explorer. Maybe you readers out there can suggest a few more using the Comments feature below.

It's in the Details

If you're a power user, then switching Explorer to Details view is the way to go: it lets you customize column widths so you can do things like display the full name of items that have long filenames. Details view also allows you to easily sort files according to name, size, type, and date modified simply by clicking on a column head. (To use Details view, choose View -> Details.) But there are a lot more details you can display for this view. For example, you can display the dimensions of image files, the date and time that a digital photo was taken, the author and number of pages of a Word or Excel file, and even the artist and album name for some music files. To customize which details are displayed, right-click on one of the column headers in Details view, then select More to display the Choose Details box and select the items you want to display:

Figure 1
Figure 1. Customizing Details view

Gimme All You Got

If you want to squeeze the most possible working space out of Windows Explorer, try running the tool in full-screen mode. Just hold down the Ctrl key and click on the Maximize button to do this. (If the window is already maximized, click on the Restore button first and then proceed as above.) The result looks like this:

Figure 2. Click for full-size image
Figure 2. Click for full-size image

Note that in full-screen mode you can choose to pin the left pane to keep it visible. (If you don't do this, the left pane slides off the screen.) Of course, if you're in full-screen mode, you don't have access to the menu bar, status bar, and other stuff, so you need to know your keyboard shortcuts to work in this mode. Here's another tip: you can add a button to your toolbar to let you switch to full-screen mode without having to hold down Ctrl. Just right-click on the toolbar, select Customize, select the Full Screen button under Available Toolbar Buttons, and click on Add.

No to All, Please

Let's say you need to copy a bunch of files from one folder into another and the destination folder has older versions of some of the files. For example, say you've written a book and have revised several of the chapters, and now you want to copy those chapters to a backup folder in which you store duplicate copies of everything you're working on. If you don't care about keeping the old versions of your chapters, you can select Yes to All when asked whether to overwrite the older files in your backup folder:

Figure 3
Figure 3: How do you say No to All?

But what if you don't want to overwrite the older versions? In that case, you could click on the No button each time the above dialog box appears. But if you're copying a number of files and there are lots of potential overwrites, then you'll be sitting there clicking on No for quite some time and muttering, "Why didn't they include a No to All button on this thing?" Fortunately, there's a way around this problem: hold down the Shift key when you click on No. This prevents Windows Explorer from overwriting any files that have the same name in the destination folder, which essentially achieves the same effect as if a No to All button were included.

Take Command with the Command Line

The usual way of starting Windows Explorer is from the GUI. I find Start -> All Programs -> Accessories -> Windows Explorer pretty tedious, so I pin Windows Explorer to the Start menu like this instead:

Start -> All Programs -> Accessories -> 
          right-click on Windows Explorer -> Pin to Start menu

Now I can start Windows Explorer simply with Start -> Windows Explorer, which is better. But by using the command line to start explorer.exe, you can do even more, since this gives you the option of adding various switches to customize how the tool works. For example, if you want to open Windows Explorer without the Folders list (left pane) then type explorer /n to do this. Similarly, explorer /e starts Windows Explorer with the Folders list visible.

Both of these methods start Windows Explorer with the focus on the C: drive, however. What if you want to start Explorer with the focus on the C:\Windows folder instead? In that case, you would type either explorer /n, /root,c:\windows or explorer /e, /root,c:\windows depending on whether you want to display the Folders list (note the commas between the switches). Or, for even more flexibility, you can use environment variables; for example, explorer /root,%windir% and so on. Type set at a command prompt to view a list of environment variables you can use.

Finally, let's say you want to add an entry to your HOSTS file, which is found in your C:\Windows\system32\drivers\etc folder. Here's a quick way to open Windows Explorer with the \etc folder selected in the Folders list:
explorer /e, /root,c: /select,c:\windows\system32\drivers\etc

Figure 4
Figure 4. Open Windows Explorer with a folder already selected

For more info on these command-line switches, see Command-Line Switches for Windows Explorer.

Mitch Tulloch is the author of Windows 2000 Administration in a Nutshell, Windows Server 2003 in a Nutshell, and Windows Server Hacks.


Return to the Windows DevCenter.

Copyright © 2009 O'Reilly Media, Inc.