Online Book Reader

Home Category

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

By Root 1312 0
Techs often use the SFC utility from within a working version of Windows or from a Windows installation disc to restore a corrupt Windows environment. If you run SFC and it finds issues, it attempts to replace corrupted or missing files from cached DLLs located in the %WinDir%\System32\ Dllcache\ directory. Without getting very deep into the mad science involved, just know that you can use SFC to correct corruption. To run SFC from a command prompt, enter SFC / SCANNOW. To familiarize yourself with SFC’s switches, enter SFC /? (Figure 15-31).

Figure 15-31 Checking SFC options with SFC /? at a command prompt

Beyond A+

Using Special Keys

You might find yourself repeatedly typing the same commands, or at least very similar commands, when working at a prompt. Microsoft has provided a number of ways to access previously typed commands. Type the DIR command at a command prompt. When you get back to a prompt, press F1, and the letter D appears. Press F1 again. Now the letter I appears after the D. Do you see what is happening? The F1 key brings back the previous command one letter at a time. Pressing F3 brings back the entire command at once. Now try running these three commands:

DIR /W

ATTRIB

MD FRED

Now press the UP ARROW key. Keep pressing it till you see your original DIR command—it’s a history of all your old commands. Now use the RIGHT ARROW key to add /P to the end of your DIR command. Windows command history is very handy.

Compact and Cipher


Windows XP and Vista offer two cool commands at the command-line interface: COMPACT and CIPHER. COMPACT displays or alters the compression of files on NTFS partitions. CIPHER displays or alters the encryption of folders and files on NTFS partitions. If you type just the command with no added parameters, COMPACT and CIPHER display the compression state and the encryption state, respectively, of the current directory and any files it contains. You may specify multiple directory names, and you may use wildcards, as you learned earlier in the chapter. You must add parameters to make the commands change things. For example, you add /C to compress and /U to uncompress directories and/or files with the COMPACT command, and you add /E to encrypt and /D to decrypt directories and/or files with the CIPHER command. When you do these operations, you also mark the directories involved so that any files you add to them in the future will take on their encryption or compression characteristics. In other words, if you encrypt a directory and all its files, any files you add later will also be encrypted. Same thing if you compress a directory. I’ll run through a quick example of each.

COMPACT

First let’s try the COMPACT command. Figure 15-32 shows the result of entering the COMPACT command with no switches. It displays the compression status of the contents of a directory called compact on a system’s C: drive. Notice that after the file listing, COMPACT helpfully tells you that 0 files are compressed and 6 files (all of them) are not compressed, with a total compression ratio of 1.0 to 1.

Figure 15-32 The COMPACT command with no switches

If you enter the COMPACT command with the /C switch, it compresses all of the files in the directory, as shown in Figure 15-33. Look closely at the listing. Notice that it includes the original and compressed file sizes and calculates the compression ratio for you. Notice also that the JPG and PNG files (both compressed graphics files) didn’t compress at all, while the Word file and the PowerPoint file compressed down to around a third of their original sizes. Also, can you spot what’s different in the text at the bottom of the screen? COMPACT claims to have compressed seven files in two directories! How can this be? The secret is that when it compresses all of the files in a directory, it must also compress the directory file itself, which is “in” the C: directory above it. Thus it correctly reports that it compressed seven files: six in the compact directory, and one in the C: directory.

Figure 15-33 Typing COMPACT /C

Return Main Page Previous Page Next Page

®Online Book Reader