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
Even while this is not a desktop FAQ, let's observe the keyboad shotcut "Open File Explorer"
Or from
Start