How to Launch Windows Explorer Using Command-Line Switches
The Windows Explorer can be launch from the Command Prompt and Run dialog box, along with a set of switches for controlling how it opens. Desktop shortcuts can be created out of these command-line switches so that your favorite folders are always only a couple of clicks away.

For example, when i want to open Windows Explorer to the C:\Scripts\BatchFiles subfolder only, with no folders above it, and using the Folders bar, I open the Command Prompt and execute following command:

Code:

Explorer /e,/root,C:\Scripts\BatchFiles


How to Launch Windows Explorer Using Command-Line Switches  MPwkilp

Above command can also be executed from Run dialog box.

How to Launch Windows Explorer Using Command-Line Switches  7yIB1bn

Not only does the Explorer open to a specific subfolder, but it also shows no folders above it.

To quickly open the current Command Prompt directory in Windows Explorer, at the Command Prompt, type:

Code:

Start .


The Start command opens a file (or directory) with the default handler. In this case, it opens the current directory (.) with Windows Explorer.

These are just one of the many uses for launching Windows Explorer from the command-line with switches; no doubt you’ll be able to find other uses for it. You’ll be able to use it not only with the command-line and with desktop shortcuts, but also if you run scripts and batch programs.

The syntax for running Windows Explorer from the Command Prompt with switches is:

Code:

explorer [/n] [/e] [,root,object] [[,/select],subobject]


You don’t have to use any switches; you can type Explorer by itself, launch your default Windows Explorer view.

Here is an explanation of how to use the switches and syntax:


/n
This switch opens Windows Explorer without displaying the Folders bar.


/e
This switch opens Windows Explorer, displaying the Folders bar. (Windows XP only.)


/root,object
This switch opens Windows Explorer to a specific object, such as a folder, without displaying the folders above it. You can also use globally unique identifiers (GUIDs) with this switch.


[[/select],subobject]
This switch opens Windows Explorer to a specific file or folder that is then highlighted or expanded. You can use the subobject switch only without the /select parameter. When you use the /select parameter, the branches are not expanded, the folder is highlighted, and the subobject is highlighted in the right pane.


Did you find this tutorial helpful? Don’t forget to share your views with us.