CompTIA®A+ Core 2 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.

Windows 7 Boot Sequence

After the BioS start up and the MBR and boot sector of the hard drive have been located and accessed, The windows Boot Manager is started. The following files are required to start windows 7.

1. Bootmgr(Windows Boot Manager): This is the Windows loader program. It takes the place of NTLDR in earlier version of windows and determines which operating system to start.

2. BCD(Boot Configuration Data): Located in \boot\bcd. It furnishes the windows Boot Manager with information about the operating system(s) to be booted. It is the successor to boot.ini and can be modified with MSCONFIG or with the bcdedit.exe program. BCD was developed to provide an improved mechanism for describing boot configuration data and to work better with newer firmware models such as the Extensible Firmware Interface (EFI).

3. Ntoskrnl.exe: The Windows kernel, which completes the boot process after being initialized by the Windows boot Manager.

4. Hal.dll: The Hardware Abstraction Layer, a software translator between Windows and system hardware.

5. SYSTEM key in the Registry: This is read to determine the system configuration.

6. Device drivers: Thease are loaded according to the information stored in the Registry.

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.

/FixMbr: This option writes a Windows 7 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.

/FixBoot: This option writes a new boot sector to the system partition by using a boot sector that's compatible with 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 7. It also displays the entries that are currently not in the BCD store. Use this option when there are 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 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/SCANNOW: SFC/SCANNOW is 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 LDR 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 Disk or chkdsk: Check Disk 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. CHKDSK command line is a free built-in hard drive repair software designed for scanning hard drives for errors or corruption and repair them if necessary. So, whenever you find your hard drive performs poorly or Windows asks you to repair drive errors, you can first try to run CHKDSK to do the job. Here's how to run CHKDSK /f through This PC in Windows 10.

1. Press Windows Key + X button to bring up the power users menu.

2. In the power users menu, select the "Command Prompt (Admin)" option.

3. Click "Yes" when you are presented with a UAC window requesting permission to launch the Command Prompt as Administrator.

4. In the new Command Prompt window, type chkdsk E: /f /r /x. Here you should replace E with your drive letter.

This option will run CHKDSK to check and repair disk errors in Windows 10. The "/f" parameter tells CHKDSK to fix any errors it finds; "/r" tells it to locate the bad sectors on the drive and recover readable information; "/x" forces the drive to dismount before the process starts.

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: It 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

A+ Core 2 Cram Notes Contents

certexams ad

simulationexams ad