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

AID: 1515
  • Status: Published

1980 points

  • By
  • TypeTips/Tricks
  • Posted on2009-09-11 at 21:57:52

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:

START .
                                  
1:

Select allOpen 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
EXPLORER /e,.
                                  
1:
2:
3:

Select allOpen 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
                                  
1:

Select allOpen 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
                                  
1:

Select allOpen in new window

and you can bring up a web page with:

start http://google.com
                                  
1:

Select allOpen in new window

or

start SomeSite.url
                                  
1:

Select allOpen 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
                                  
1:

Select allOpen 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
                                  
1:

Select allOpen in new window

net start "Remote Registry"
                                  
1:

Select allOpen 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!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Asked On
2009-09-11 at 21:57:52ID1515
Tags

DOS Box

,

command prompt

,

net command

,

start command

,

explorer /e

Topic

DOS and Windows

Views
1309

Comments

Add your Comment

Please Sign up or Log in to comment on this article.

Loading Advertisement...

Top DOS & Windows Experts

  1. DanRollins

    280

    0 points yesterday

    Profile
    Rank: Genius
  2. nordtorp

    80

    0 points yesterday

    Profile
    Rank: Guru
  3. adiloadilo

    70

    10 points yesterday

    Profile
    Rank: Master
  4. v_prawin

    30

    10 points yesterday

    Profile

Hall Of Fame