Windows Tip Sheet
Explore Your World
What? Windows Explorer as a GUI for admin tasks. Uh, kinda.
- By Jeffery Hicks
- 12/12/2007
As much as I prefer working in the command line, there are times when it is easier to do something in Windows Explorer. Sometimes, I simply want a few Explorer windows open so I can move some files around. If I’m in a command prompt I still want to get to the graphical interface as fast as possible. To accomplish this, all I need to do is type an expression like this:
C:\ explorer /e /root,C:\Scripts
This will open an instance of Windows Explorer rooted to C:\Scripts. Personally, I prefer this view. But you can also use:
C:\ explorer /n /root,C:\Scripts
Which will open up a “My Computer” type view rooted at C:\Scripts.
If you are in a command prompt and are already in the directory you want to open, which is often my situation, simply type:
C:\ explorer /e /root,%cd%
How easy is that? This is especially handy if you are in some deeply nested subfolder with long directory names. In a snap I can open a Windows Explorer window and be where I need to be.
This technique can also be taken one step further:
C:\ explorer /e,/select,%windir%\notepad.exe
If you tried this, you should have an open Explorer window and Notepad.exe should be highlighted. I’ll make this even easier for you. Copy this batch file to a directory in your path:
::EXP.BAT
::USAGE - EXP DIRECTORYPATH
@echo off
if %1$==$ (
set spath=%CD%
) else (
set spath=%1
)
echo opening %spath%
explorer /e,/root,%spath%
set spath=
Tech Help -- Just An
E-Mail Away |
Got a Windows, Exchange or virtualization question
or need troubleshooting help? Or maybe you want a better
explanation than provided in the manuals? Describe
your dilemma in an e-mail to the MCPmag.com editors
at [email protected];
the best questions get answered in this column and garner
the questioner with a nifty Redmond T-shirt.
When you send your questions, please include your
full first and last name, location, certifications (if
any) with your message. (If you prefer to remain anonymous,
specify this in your message, but submit the requested
information for verification purposes.) |
|
|
The next time you want to open an Explorer window from a command prompt simply type:
C:\ exp %windir%
to open your Windows directory. If you run EXP without specifying any parameters, then an Explorer window will open, rooted to the current directory. It doesn’t get much easier than that.
About the Author
Jeffery Hicks is an IT veteran with over 25 years of experience, much of it spent as an IT infrastructure consultant specializing in Microsoft server technologies with an emphasis in automation and efficiency. He is a multi-year recipient of the Microsoft MVP Award in Windows PowerShell. He works today as an independent author, trainer and consultant. Jeff has written for numerous online sites and print publications, is a contributing editor at Petri.com, and a frequent speaker at technology conferences and user groups.