![Page 1: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/1.jpg)
®®Microsoft Windows 7 for Power Users
Tutorial 13Using the Command-Line
Environment
![Page 2: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/2.jpg)
XPXPXPXPXPXPObjectives• Learn about the importance of command-line
skills• Use internal and external commands• Customize a command-line window• Pipe output to the More filter• Compile information about a computer and its
power usage
Windows 7 for Power Users Tutorial 13 2
![Page 3: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/3.jpg)
XPXPXPXPXPXPObjectives• Display a directory tree, change directories,
and view directory listings• View file attributes• Create a directory and copy files• Use wildcards to streamline command
operations• View the Windows environment and create an
environment variable
Windows 7 for Power Users Tutorial 13 3
![Page 4: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/4.jpg)
XPXPXPXPXPXPCommand Help
Windows 7 for Power Users Tutorial 13 4
![Page 5: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/5.jpg)
XPXPXPXPXPXPThe Importance of Command-Line Skills• Provides a way to operate your computer
without a graphical user interface• Essential for those who manage networks or
provide technical support• Helps to understand how the Windows
operating system works
Windows 7 for Power Users Tutorial 13 5
![Page 6: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/6.jpg)
XPXPXPXPXPXPWorking with the Command Interpreter• To work in a command-line environment under
Windows 7, you first open a command-line window
• A command interpreter is a program that interprets commands entered at the command prompt, locates the appropriate program in memory or on disk, loads the program (if necessary), and then executes the program
Windows 7 for Power Users Tutorial 13 6
![Page 7: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/7.jpg)
XPXPXPXPXPXPOpening and Closing a Command Prompt Window• From the Start menu, point to All Programs, click
Accessories, and then click Command Prompt. Or from the Start menu, type CMD in the Search programs and files box, and then press the Enter key
• If you want to open a Command Prompt window with Administrator credentials, right-click Command Prompt on the Accessories menu, click the Run as administrator check box (and add a check mark), and then specify Administrator credentials
• To close the Command Prompt window, type EXIT and then press the Enter key
Windows 7 for Power Users Tutorial 13 7
![Page 8: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/8.jpg)
XPXPXPXPXPXPWorking with the Command Interpreter
Windows 7 for Power Users Tutorial 13 8
![Page 9: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/9.jpg)
XPXPXPXPXPXPWorking with the Command Interpreter• Once you open a Command Prompt window, you can
enter commands at the command prompt to perform specific operations– Internal commands (common and important types
of operations)– External commands (program code resides in a
specific file on disk)• To locate Help information about the use of the
internal and external commands, you can use the Help switch (/?) or the HELP command
Windows 7 for Power Users Tutorial 13 9
![Page 10: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/10.jpg)
XPXPXPXPXPXPUsing Help to Specify Console Colors• Default background color is black, and text
color is white• Use the COLOR command to customize the
Command Prompt window
Windows 7 for Power Users Tutorial 13 10
![Page 11: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/11.jpg)
XPXPXPXPXPXPUsing Help to Specify Console Colors
Windows 7 for Power Users Tutorial 13 11
![Page 12: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/12.jpg)
XPXPXPXPXPXPRecalling Commands from the Command History• To recall the previously entered command in a
Command Prompt window, press the Up Arrow key or press the F3 key
• To display the command history, press the F7 function key, use the Up Arrow key or Down Arrow key to select the command you want to use, and then press the Enter key
Windows 7 for Power Users Tutorial 13 12
![Page 13: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/13.jpg)
XPXPXPXPXPXPRecalling Commands from the Command History
Windows 7 for Power Users Tutorial 13 13
![Page 14: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/14.jpg)
XPXPXPXPXPXPUsing External Commands• You can use the LABEL command to assign a
volume label to a drive
Windows 7 for Power Users Tutorial 13 14
![Page 15: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/15.jpg)
XPXPXPXPXPXPUsing the Pipe Operator to Display a Command-Line Reference List• HELP | MORE– Pipe operator redirects
the output to the MORE filter• Produces paged
output– Entire command is
called a pipeline
Windows 7 for Power Users Tutorial 13 15
![Page 16: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/16.jpg)
XPXPXPXPXPXPUsing the SystemInfo Command• Displays configuration information about a
computer and its operating system• Clear the screen, type systeminfo | more and
then press the Enter key
Windows 7 for Power Users Tutorial 13 16
![Page 17: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/17.jpg)
XPXPXPXPXPXPUsing the SystemInfo Command
Windows 7 for Power Users Tutorial 13 17
![Page 18: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/18.jpg)
XPXPXPXPXPXPProducing a Power-Efficiency Diagnostics Report• The external POWERCFG (Power Configuration)
command is a command-line tool for controlling power settings on a computer
• Type powercfg -energy (with a space before the switch), and then press the Enter key
Windows 7 for Power Users Tutorial 13 18
![Page 19: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/19.jpg)
XPXPXPXPXPXPProducing a Power-Efficiency Diagnostics Report
Windows 7 for Power Users Tutorial 13 19
![Page 20: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/20.jpg)
XPXPXPXPXPXPNavigation
Windows 7 for Power Users Tutorial 13 20
![Page 21: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/21.jpg)
XPXPXPXPXPXPWorking with Directories and Files• TREE command displays directory structure of
current directory and subdirectories
Windows 7 for Power Users Tutorial 13 21
![Page 22: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/22.jpg)
XPXPXPXPXPXPWorking with Directories and Files• Change to the root directory by typing cd \ and
then pressing the Enter key
Windows 7 for Power Users Tutorial 13 22
![Page 23: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/23.jpg)
XPXPXPXPXPXPViewing the Contents of a Directory• DIR command lists subdirectories and files within a
directory– /a attribute switch includes hidden directories and
files• /ad only shows directories
– /O lists subdirectories first in alphabetical order– /P displays one screen of output at a time• Press SPACEBAR to view next page
• cd directoryname changes directory to name specified
Windows 7 for Power Users Tutorial 13 23
![Page 24: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/24.jpg)
XPXPXPXPXPXPViewing File Attributes• ATTRIB command lists attributes assigned to
files–Also can be used to change file attributes
Windows 7 for Power Users Tutorial 13 24
![Page 25: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/25.jpg)
XPXPXPXPXPXPViewing File Attributes
Windows 7 for Power Users Tutorial 13 25
![Page 26: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/26.jpg)
XPXPXPXPXPXPCreating a Directory• MD (Make Directory) command creates a
directory on a disk–md “directoryname”
Windows 7 for Power Users Tutorial 13 26
![Page 27: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/27.jpg)
XPXPXPXPXPXPCopying Files• The COPY command copies files from one
location to another–COPY source destination
Windows 7 for Power Users Tutorial 13 27
![Page 28: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/28.jpg)
XPXPXPXPXPXPChanging Drives• Change drives by typing the drive name at the
command prompt and then press the Enter key
Windows 7 for Power Users Tutorial 13 28
![Page 29: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/29.jpg)
XPXPXPXPXPXPUsing Wildcards in File Specifications• A file specification is a notation for selecting
one or more files in a command operation• A wildcard is a symbol used to select a group
of files–Asterisk wildcard (*)• Substitutes for all or part of a filename
–Question mark wildcard (?)• Substitutes for a single character in a
filename
Windows 7 for Power Users Tutorial 13 29
![Page 30: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/30.jpg)
XPXPXPXPXPXPUsing Wildcards in File Specifications
Windows 7 for Power Users Tutorial 13 30
![Page 31: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/31.jpg)
XPXPXPXPXPXPViewing the Windows Environment• The Windows path (PATH environment
variable) locates the program files for external commands
Windows 7 for Power Users Tutorial 13 31
![Page 32: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/32.jpg)
XPXPXPXPXPXPViewing the Windows Environment• The DIRCMD variable allows you to use the DIR
command without having to specify the same set of switches each time
Windows 7 for Power Users Tutorial 13 32
![Page 33: Tutorial 13 Using the Command-Line Environment](https://reader034.vdocuments.mx/reader034/viewer/2022051118/56816046550346895dcf691b/html5/thumbnails/33.jpg)
XPXPXPXPXPXPCreating a Batch Program• A batch program (or batch file) is a user-
defined program that contains a list of executable commands–Uses the .bat file extension
• Each command is listed on a different line
Windows 7 for Power Users Tutorial 13 33