Windows Explorer Command-Line Switches

You can use the command-line switches for Windows Explorer in shortcut links or batch files, for example, to run Windows Explorer with a specified file selected.

Syntax

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

Parameters

/n

Always open a new window (even if the specified folder is already open).

/e

Use Windows Explorer view. The default is Open view.

/root,object

Specify the object in the normal namespace that will be used as the root of this Windows Explorer Folder. The default is to just use the normal namespace root (the desktop).

subobject

Specify the folder to receive the initial focus unless /select is used. The default is the root.

/select

Specifies that the parent folder is opened and the specified object is selected.

Windows Explorer Examples

To open a window rooted at \\myserver so you can easily browse the whole server, but nothing else:


explorer /e,/root,\\myserver

To open a folder window on C:\WINDOWS (or make an open window active) and select CALC.EXE, use:


explorer /select,c:\windows\calc.exe