Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Command Line Tips: Show Explorer Here, Execute a Document, Control System Services

Published on
9,903 Points
3 Endorsements
Last Modified:
Here are some tips for you "DOS box" users -- system administrators, developers, etc., who find yourself at the Command Prompt window for part of your daily tasks.

1. Show Explorer Here

In a previous EE Article, I described how to get to the "DOS Command Prompt" while using a context menu in Windows Explorer, in such a way that the selected folder is the "current directory" for your commands.  Well, what about the opposite action?  

You are at the command prompt and want to bring up Windows Explorer, with its focus on the current directory.  Here's one way:

Open in new window

That will bring up the Explorer "one-pane, simple view" but as a power user, you will surely want the Two-Pane Explorer that shows the directory tree on the left.  What I've done to make that happen was write a batch file like so:
REM - EX.bat
REM -- displays Windows Explorer in two-pane mode on current directory

Open in new window

I put that batch file in the C:\Windows directory so it's on the command search path and now I can go back and forth with ease.

2. Execute Documents (text files, spreadsheets, web pages, etc.)

At the command prompt, you could use commands like CD or DIR or FIND, but the Windows interactive versions are much better, in so many ways.  You want to get your GUI on.   For instance, if you have a text file named REPORT.TXT you could use commands like TYPE or MORE, but that is so... 1970.  You are not a UNIX nerd!  

The program Notepad.Exe (or your own favorite text editor [mine's called Visual Studio]) is already associated with the file extension of .TXT so you can easily bring up that file in the GUI like so:
start report.txt

Open in new window

I'm sure you know that already.  Sorry.  
But you might not know that you can bring up an Explorer by "starting" a directory name.  For instance,
start c:\myproj\UltraTool

Open in new window

and you can bring up a web page with:
start http://google.com

Open in new window

start SomeSite.url

Open in new window

The latter option relates to what happens when you drag an icon from the Internet Explorer Address Bar or drag any hyperlink from any page and drop it onto the desktop (or other directory).  It shows as a shortcut, but it is actually a file with an extension of .URL  -- even though Windows will not show that extension in the Explorer.

3. Control System Services

If you find yourself navigating to Control Panel / Administrative Tools / Services at all often, then you may not know this.  There is a quick and easy way to stop and start System Services from the command prompt.  It is the NET command (not a particularly intuitive choice for a command name, and that's why I mention it here.)   E.g.:
net start MyService

Open in new window

Where MyService is the text displayed in the "Name" column of the Service Manager.  About the only tidbit I have to add is that if the service name contains an embedded space, you need to wrap it in quotes:
net stop Messenger

Open in new window

net start "Remote Registry"

Open in new window

If you liked this article and want to see more from this author,  please click the Yes button near the:
      Was this article helpful?
label that is just below and to the right of this text.   Thanks!
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Join & Write a Comment

Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month