Online Book Reader

Home Category

CompTIA A_ Certification All-In-One Exam Guide, Seventh Edition - Michael Meyers [245]

By Root 1491 0

Accessing the Command Line

Before you can use the command-line interface, you have to open it. You can use various methods to do this, depending on the flavor of Windows you are using. Some methods are simpler than others; just make sure that you know at least one, or you’ll never get off the starting line!

Figure 15-4 Contents of C: in Computer—Details view

One easy way to access the command-line interface in Windows 2000 or XP is by using the Run dialog box. Click the Start button, and then select Run. If you’re using Windows 2000 or Windows XP, type CMD or COMMAND and press the ENTER key (Figure 15-5). If you are using Vista, you access the command-line interface through the Start menu Search box with the same two commands. A window pops up on your screen with a black background and white text—this is the command-line interface. Alternatively, buried in the Start menu of most computers, under Programs | Accessories, is a link to the command-line interface. In Windows 2000, XP, and Vista, it’s called command prompt. These links, just like the Run dialog box, pull up a nice command line-interface window (Figure 15-6). If you are displaying the command-line interface in Windows Vista, notice that it uses a newer version number and copyright date. Also notice that the default user profile directory is C:\Users\User name rather than C:\Documents and Settings\User name as in previous operating systems (shown in Figure 15-7). To close the command line-interface window, you can either click the Close box, as on any other window, or simply type EXIT at any command prompt and press ENTER.

Figure 15-5 Type CMD in the Run dialog box to open a command-line window.

Figure 15-6 The command line-interface window with a C:\ prompt

Figure 15-7 The Windows Vista command-line interface window

If you attempt to enter a command at the Windows Vista command prompt that requires elevated or administrative privileges, you receive a UAC “Windows needs your permission to continue” dialog box (you’ll learn more about UAC in the next chapter, “Securing Windows Resources”). You can also “manually” run a command with elevated privileges by right-clicking a command-prompt shortcut and then selecting Run as administrator. If you are prompted for administrator password or credentials, enter them as needed.

* * *

NOTE You can also create an administrator shortcut to the Windows Vista command prompt by right-clicking the Desktop, Select New | Shortcut. Then for the location of the item, type CMD and click Next. Type CMD to name the shortcut and click Finish. Your shortcut appears on the Desktop. Next, right-click the shortcut and select the Advanced button. In the Advanced Properties dialog box, check the Run as administrator box and click OK. You have now created a Windows Vista command-prompt shortcut that will always run with administrative privileges.

The Command Prompt

The command prompt is always focused on a specific folder. This is important because any commands you issue are performed on the files in the folder on which the prompt is focused. For example, if you see a prompt that looks like the following line, you know that the focus is on the root directory of the C: drive:

C:\>

If you see a prompt that looks like Figure 15-8, you know that the focus is on the C:\Diploma\APLUS\ folder of the C: drive. The trick to using a command line is first to focus the prompt on the drive and folder where you want to work.

Figure 15-8 Command prompt indicating focus on the C:\ Diploma\APLUS\ folder

* * *

NOTE You can hold down the F5 or F8 key during boot-up to access the Windows 2000, Windows XP, or Windows Vista Advanced Boot Options menu. This has an option to boot to Safe Mode with Command Prompt, which loads the GUI into Safe Mode and then overlays that with a command-line interface for rapid access to a prompt. This saves you the step of going to Start | Run and typing CMD. This is not the old-style command prompt–only interface!

Filenames and File Formats

Windows manifests each program

Return Main Page Previous Page Next Page

®Online Book Reader