Explorer.exe Command-Line Switches

 

Explorer.exe is the main entryway for you to view and work with files on your computer – it displays all files on your hard drive (except for hidden and system files, which you can still see if you change the default configuration).

Explorer.exe command line switches can be used to control the initial view that Explorer will open with.  Although you can control the number of panes (one or two) and the top level folder that will be shown - unfortunately there is no switch to dictate the type of View - such as Details, Icons, etc

Resources

Win95-98-ME             http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q130510&

Win XP                        http://support.microsoft.com/default.aspx?scid=KB;EN-US;q307856&

Win NT                        http://support.microsoft.com/default.aspx?scid=kb;en-us;Q152457

http://www.infoworld.com/articles/op/xml/00/07/03/000703oplivingston.xml  (for hidden switches)

It may seem odd, that although Explorer is the most frequently used application – Microsoft has never placed a shortcut to it on your desktop by default during installation.  The same holds true for Control Panel.  The reason is understandable – giving users easy access to these two powerful applications would definitely increase the number of support calls and subsequent damage to the computer’s configuration by newbies.

But you – of course – need these apps – so the first thing you want to do is to create a shortcut on your desktop to Explorer.exe

 

Create your own Explorer Shortcut !!

In Windows 2000 and XP, Explorer frustrates many people by starting up with its focus on My Documents. Windows 98 Explorer, by contrast, starts up more intuitively, focused on C: drive.

In the first place – NEVER USE THE START MENU !!  It’s a clunky way of accessing and starting applications.  So go ahead and create a shortcut to Explorer on your desktop, and one on your Quick-Launch bar just to the right of the START button.  Let’s fix this right away. 

 

The Best Switch -  /e  -  BUT !!!

Right-click anywhere on your desktop and select New/Shortcut . . . and type in for the command line:

Windows 95-98:          c:\windows\Explorer.exe /e, c:\

Win 2000-XP:              %SystemRoot%\Explorer.exe /e, c:\

Then give the shortcut a new – “Explorer” of course, and the new shortcut is created.  Right-click the new Desktop shortcut, drag it to your Quick-Launch bar, release the mouse button and click “copy”.  You now can open up Explorer even when your desktop is littered with windows, by using the Quick-Launch taskbar.

NOTE:  the /e option by itself opens Explorer maximized every time, which is not what most people want.  The workaround is to place the target drive at the end of the command line, as shown.

 Now Explorer is easily accessible and will open up with your main drive selected and it will be expanded by one level (all the immediate first-level subfolders will be visible).  For most people – that’s it !!  Now they can do everything they want with Explorer.  For the rest of you that have more grandiose plans in mind . . . read on . . .

Let’s look at a few of the most common switches.  For example:

c:\windows \explorer.exe /n, /e, c:\.

 The syntax of these parameters is as follows:

explorer {/n} {,/e} {,/root, x} {{,/select}, y}.

The /n switch opens a new Explorer window, even if an existing window is open. The /e switch specifies a two-pane Explorer view, rather than a single pane. Note that commas are necessary between parameters.

The /root and /select switches make things interesting. You use /select -- followed by file, folder, or computer name y -- to highlight the selected object and put Explorer's focus on its parent. You use /root in the same way, followed by x, to open Explorer with object x fixed at the "top" of the tree view.

You would typically use the /select switch to make Explorer start with a specific folder or drive selected. By contrast, the /root switch, which is used less often, makes Explorer display a window in which the "root" you've specified is as high as you can go.

Here are some examples. The following command line would start Explorer with the Docs folder open and the file Today.doc selected: explorer /n, /e, /select,c:\docs \today.doc.

Perhaps you don't need to select a specific file but only want Explorer to focus on a different drive letter than the default. In that case, you can dispense with the optional /select switch and simply name the drive.

For example, the following command line would cause Explorer to open with its focus on the D: drive, which might be your CD-ROM or other device: explorer /n, /e, d:\.

The following /root command would start Explorer with Server1 at the top of the tree: explorer /n, /e, /root, \\server1.

 

The Details

Explorer [/e,] [/n,][/root,<object>,] [[<folder>]| [/select, <sub object>]]

Important :  you must separate all switches with a comma !!!

   /e              Use “Explorer view”, which is 2 panes.  The left Pane is “containers” such as drives and folders (directories).  The right pane is the contents of the selected container from the left pane.  The right pane is limited to showing only sub-folders and files.  The default is open view (results in                    pane view only).

   /n                     Opens a new window in “My Computer view”, which is a single-pane. Displaying the contents of a container.  This is the same pane as the right pane in the 2-pane Explorer view.             

   /root<object>   Specify the object in the "normal" name space that is used as the root (top level)

                   for Windows Explorer. The default is the Desktop folder.

   /select         The parent folder opens and the specified object is selected.

   <sub object>    The folder or file that Windows Explorer opens. If the /select switch is used, the

                   sub object is highlighted. If the /select switch is not used, the folder or file opens

                   in Explorer. The default is the root<object>.

 

Examples:

NOTES:

*      if you use no switches and simple make a shortcut to Explorer it will be double-pane

*      if you use no switches and specify a target folder it will be single-pane

*      if you want a target folder with double-pane, use the /e switch

explorer /select, C:\Windows\Calc.exe         - opens a folder at C:\Windows (or activates one that is currently open), and selects Calc.exe.

D:\windows\explorer.exe /e,"c:\temp"                     - opens a double pane with C:\Temp selected

D:\windows\explorer.exe "c:\temp" - opens a single pane in C:\Temp

D:\windows\explorer.exe /n, /e, /select,c:\temp\temp1         - opens a double-pane in c:\temp with C:\temp\temp1 selected in the right Pane

The /n switch

D:\windows\explorer.exe /n             - opens a single pane with the contents of the D drive

 

Using /n and /e together

The /e takes precedence and the /n is ignored – so you will see the “Explorer view” (double-panes)

 

The /root switch

Explorer /e, /root, \\Reports              - opens an Explorer window at \\Reports. (does not work with XP)

Explorer /e, /root, \Source\Internal\Design\Users\David\Archive

Opens a folder to the Archive folder. This is a good way to create a dedicated, remote, documents archive folder. A link to the Source\Internal\Design\Users\David\Archive folders can then be placed in the SendTo folder for quick routing of documents.