<http://www.netikka.net/tsneti/info/tscmd155.htm>
Copyright © 2003-2010 by Prof. Timo Salmi  
Last modified Sat 17-Apr-2010 07:13:43

 
Assorted NT/2000/XP/.. CMD.EXE Script Tricks
From the html version of the tscmd.zip 1cmdfaq.txt file
To the Description and the Index
 

This page is edited from the 1cmdfaq.txt faq-file contained in my tscmd.zip command line interface (CLI) collection. That zipped file has much additional material, including a number of detached .cmd script files. It is recommended that you also get the zipped version as a companion.

Please see "The Description and the Index page" for the conditions of usage and other such information.



155} How can I use command-line to open a Windows Explorer window?

The simplest format is just
explorer

To open a window view with the current file selected
@echo off & setlocal enableextensions
explorer /select,"%~f0"
endlocal & goto :EOF


To open multiple windows use e.g.
@echo off & setlocal enableextensions
explorer /select,"%~f0"
explorer /select,"C:\_D\TEST\CMDFAQ2.CMD"
endlocal & goto :EOF

E.g. the following command
Explorer /n,"C:\Documents and Settings"
will open a normal folder window view to C:\Documents and Settings
Explorer /e,/select,C:\WINDOWS\system32\cmd.exe
will open an extended folder window with cmd.exe selected.

There is a twist. What if you wish to open a zip-file in an explorer window?
C:\>rundll32.exe zipfldr.dll,RouteTheCall C:\_M\TestFolder\pakettig.zip


References/Comments: (If a Google message link fails try the links within the brackets.)
  http://support.microsoft.com/kb/314853/en-us
  http://support.microsoft.com/kb/307856/en-us
  http://support.microsoft.com/kb/555305/en-us
  Windows Explorer Command-Line Options
  Google Groups Fri, 08 Aug 2008 11:14:35 +1000 [M]