CompTIA®A+ Practical Exam Notes : Microsoft Command Line Tools Reference

1. Windows Operating Systems

1.3 Microsoft command line tools

Boot Methods:If you fail to boot, first try to boot in Safe Mode. If it doesn't work, try booting to Last Known Good Configuration. If both fail, you can try using Recovery Console. You need to install the Recovery options for choosing this option on your Win 7 computer. If the option is not installed, you may get to the Recovery options by using the Win 7 installation CD ROM.

The file ntbtlog.txt file contains information collected if you choose to boot using "Boot Logging" startup option. The file shows which drivers are loaded and which have failed to load.

File required to boot Windows Vista operating system are BCD, Hal.dll and ntoskrnl.exe

To restore Windows Boot Loader in Windows 7 computer, do the following:

The Bootrec.exe tool supports the following options. Use the option that's appropriate for your situation.

1. /FixMbr :This option writes a Windows 7 or Windows Vista-compatible MBR to the system partition. It does not overwrite the existing partition table. Use this option when you must resolve MBR corruption issues, or when you have to remove nonstandard code from the MBR.

2. /FixBoot :This option writes a new boot sector to the system partition by using a boot sector that's compatible with Windows Vista or Windows 7. Use this option if one of the following conditions is true:

  • The boot sector was replaced with a nonstandard Windows Vista or Windows 7 boot sector.
  • The boot sector is damaged.
  • An earlier Windows operating system was installed after Windows Vista or Windows 7 was installed. In this situation, the computer starts by using Windows NT Loader (NTLDR) instead of Windows Boot Manager (Bootmgr.exe).

3. /ScanOs : This option scans all disks for installations that are compatible with Windows Vista or Windows 7. It also displays the entries that are currently not in the BCD store. Use this option when there are Windows Vista or Windows 7 installations that the Boot Manager menu does not list.

4. /RebuildBcd :This option scans all disks for installations that are compatible with Windows Vista or Windows 7. Additionally, it lets you select the installations that you want to add to the BCD store. Use this option when you must completely rebuild the BCD store.

Recovery Console provides command prompt options for recovering failed operating system boot process. If the OS is not recognized at all, you may start with FixMBR command as below:

bootrec.exe /FixMbr: Repairs the Master Boot Record

Though the above command fixes the MBR, there still might be an error with the system partition's boot sector and Boot Configuration Data (BCD). This might occur if you have tried to install another operating system alongside Windows 7, such as Windows XP. Use the FixBoot command as below:

bootrec.exe /FixBoot

If you are still faced with your Windows 7 installation not being detected during start up, or if you wish to include more than one operating system choice to your system's boot list, you can try the following command to rebuild your BCD:

bootrec.exe /RebuildBcd:This command will scan all your disks for other operating systems compatible with Windows 7 and allow you to add them to your system's boot list.

Boot from Windows Vista installation disc, select language and keyboard or input method, click Next and choose to Repair your computer. Then you will need to select the operating system that you want to repair. In the System Recovery Options dialog box click Command Prompt and type the following:

Bootrec.exe /FixMbr

Bootrec.exe /Fix Boot

SFC /SCANNOWis used to scan to see if you have any missing, corrupted, or modified Windows system files. If any are found, then SFC will attempt to repair them by replacing them with a clean copy from the component store if the component store is not corrupted as well. Usually you would only need to run a SFC scan if you suspect an issue caused by as issue with your system files in Windows. The sfc scannow option is one of several specific switches available in the sfc command, the Command Prompt command used to run System File Checker. Sfc /scannow is the most common way that the sfc command is used.

Sfc /scannow will inspect all of the important Windows files on your computer, including Windows DLL files. If System File Checker finds an issue with any of these protected files, it will replace it.

Check Diskor chkdsk is used to see if a hard drive has any file system errors and bad sectors on it, and attempt to repair or isolate them if found. Usually it's a good idea to run chkdsk at least once a month, or as needed.

DEFRAG:Fragmentation makes your hard disk do extra work that can slow down your computer. Removable storage devices such as USB flash drives can also become fragmented. Disk Defragmenter in Windows rearranges fragmented data so your disks and drives can work more efficiently. In other words, DEFRAG utility arranges the clusters of data on the hard drive to achieve better performance by placing all of the clusters for a given file together in a contiguous order. Disk Defragmenter runs on a schedule, but you can also analyze and defragment your disks and drives manually. DEFRAG does not do any repair on your disk, and errors, if any will remain on the disk.

compmgmt.msc:This command opens computer management console.

The switch /s will make all the files and sub directories to be marked as archive.

HKEY_LOCAL_MACHINE is the hive where the information specific to the machine will be stored. The information may include, network settings, hardware drivers etc.

HKEY_LOCAL_USER hive stores data specific to user configuration, such as desktop color schemes, screen savers, wall paper, and user specific application settings.

Previous   Contents   Next