|
The Command Line Part 2 - Some
Nice Features
The Command Line Part 1
The Command Line Part 2
The Command Line Part 3
The Command Line Part 4
Features on the
Command Line
Again, my intention here is not to
teach you DOS, but to point out some features and facts about
working at the command line that you may not have known before.
Here is a list of some additional
commands you might find useful while you are navigating the file
system. Simple commands that help to make things a bit easier, such
as:
F3 = repeat the last command,
F7 = Display a command history, etc...
Here's the list. My favorite is F3.

Another little feature I've found
through working at the command line is drag and drop. Let's
say you create a bunch of icons which run DOS commands and they are
sitting on your desktop. Did you know you can open a command window
and then drag the that icon and drop it into the command window and
the command is copied to the window. All you have to do is hit
enter. Could come in handy.
Did you know that DOS has an
Editor Program as well. All you need to do is type in "Edit".
Even works with the mouse.
This is what the editor program looks
like.

You can also DO THE REVERSE. You can
copy from the Command Window to an application such as Word.
Here's an example of how that works:
1>At the Command Line type in the command
DIR
and then hit Enter to get a directory listing.
2>Click on the icon in the upper left corner of the DOS Window,
select Edit, then Mark. Cursor is now
top left and blinking.
3>Now starting at a corner of the area
you want to copy, hold left mouse down and drag the mouse to
highlight a rectangular
area to copy.
4>Now right click on the Window icon upper left again, select edit
and then copy.
5>Now go to the application you were using, such as Word, and select
paste. There's your dir listing.
Another little tip that I use often is
the Print Screen trick. It is often convenient or necessary
to "capture" a screen image for future reference, documentation,
troubleshooting, or whatever. Make sure the window you want to copy
is "in focus," then press Alt + Print Screen. This captures
the active window as a bitmap image to the clipboard. Now you can
open the Paint program or MS Word and paste that bmp graphic file
right into the program. Can be useful for clients to send copies of
errors they see or for presentations such as this. ;)
Tips for Using the Windows Command
Prompt
Stopping a runaway command
Sometimes you start a command only to find that it is going on
and on, spewing out screen after screen of output.
Most of the time you can terminate a
command by simultaneously pressing the two keys "CTRL" and "c". This
is known as the “break” command, which can also be issued with the
“CTRL” + BREAK keyboard sequence.
Pausing a scrolling screen
If you have a command with a lot of output, you can pause the
scrolling so that you can read what's on the screen. Use the
keyboard combination"CTRL+S". To resume scrolling, repeat
CTRL+S
Use drag and drop
Having to type the fully qualified path of a file every time it's
needed in a command can be tedious and subject to error. Many people
are unaware that a file can be dragged from a folder or Windows
Explorer view and dropped on an open command window. It saves a lot
of typing. (Doesn't work in Vista)
Go up one level above the working directory
To go up to the parent directory that is one level above the working
directory, enter cd .. You can repeat this to go up more
levels.
How to change the working directory to a
folder on a different drive
If you want to change the working directory for a command window to
a folder on a different drive, the command"cd" doesn't work. You
have to first enter the drive letter and colon ( d: then enter )
and then enter "cd" to change to the desired folder path. However,
you can use the switch /d to change to the current working
directory drive in one command line using the following command:
cd /d d:\test
Watch out for spaces in file and folder
names
The command shell does not recognize spaces in path names. Any path
name with spaces must be enclosed in quotation marks. So if you are
going to be referring to a folder name such as Program Files, you
need to enclose the name in quotes. Use the designation “Program
Files” so it recognizes the space in the name.
Pin a command-line shortcut to the Start
menu
If you use the command prompt frequently, make it easily accessible.
Open Start-All Programs-Accessories and right-click the entry
"Command Prompt". Select "Pin to Start menu" from the
context menu.
Create a shortcut to a command
If there is a command that you use frequently, you can create a
shortcut. The trick is to use the switch /k so that the command
prompt stays open. The entry for the shortcut should be cmd /k
somecommand.exe If the command
also needs switches, those can be added as well.
Open Windows Explorer from the command line
To open the current command-line directory in a Windows Explorer
window use the command: start .
To open the directory above the current command-line directory in a
Windows Explorer window use the command: start ..
Save typing with file-name and folder-name
completion
Those of you familiar with Linux will recognize this command. A very
useful feature that can save a lot of typing is the name or path
completion function. This feature uses the Tab key to
complete file and folder names that you begin typing. The tab key
tries to anticipate what file or command you could be looking for.
You start typing in the command, but don’t finish it. Instead you
hit the tab key and it tries to finish the command for you. It’s
better illustrated by an example. Open a command window.
Type in “cd” and a space as if you were going to change to another
folder. Before you enter the name of the folder to change to hit the
tab key. Now keep hitting the tab key. Notice that it’s listing all
the possible folders you could change to. When the one appears that
you want to change to hit enter. The list that the tab key will show
you depends on the command you issued. Cool Huh?
Display the Command History
The default setting for the command window stores up to 50 of the
previously entered commands. The command history can be displayed by
entering the "F7" key.
|