The Windows Recovery Environment Command Prompt – CompTIA A+ 220-902 – 1.3

If you’re troubleshooting a significant startup problem, then the Windows Recovery Environment and the command prompt may be your only choice for resolving the issue. In this video, you’ll learn how to start the recovery environment’s command prompt and how to resolve startup problems from the command line.

<< Previous: Operating System Command Line ToolsNext: Windows Administrative Tools >>


If you’re having problems with your operating system starting or you need to access part of the operating system before the OS actually loads, then you need to be very familiar with the Windows Recovery Environment and the Command Prompt inside of it.

The Windows Recovery Environment is very powerful. You have complete access to the operating system, all from this recovery environment. But because of that, this is also very dangerous. You need to know exactly what you’re doing inside of this recovery environment. If you make the wrong decision and delete the wrong files, you’ll find that the operating system won’t work at all.

One nice part of this Recovery Environment though is that you do have complete control. You can make changes to services, you can modify files, and you can fix problems that normally would not be fixable from just the operating system itself. For example, you can do things like copying, renaming, replacing, operating system files. You can enable or disable certain services or devices from starting when the operating system loads.

In this video, you’re also going to learn how to repair the File System Boot Sector and the master boot record from this Command Prompt. And you can also change partitions. You can modify, delete partitions that are on the disk and make extensive changes to the way the operating system is configured.

To start this Recovery Environment and get to the Command prompt, you need the installation media for your operating system. So if you’re running Windows Vista, Windows 7, or Windows 8 or 8.1, you will need the installation media for each of those.

In Windows Vista and Windows 7, it’s the same process. You go to the System Recovery options and choose Command Prompt. In Windows 8, it’s a little bit different. You go under Troubleshoot, Advanced Options, and Command Prompt.

Windows Vista and Windows 7 work exactly the same, so I’ll show you the process in Windows 7. I’ve started Windows 7 from the Installation Media, and the first page is the language, time, and keyboard entries. I’m going to choose the defaults here.

And there is an option to Install Now, but obviously we’re not going to install the operating system. Instead, we’re going to choose the option to Repair Your Computer. At this point, the Windows installation will look through the drives that are on your system to find all of the different operating systems that might be installed.

And it did find a Windows 7 on my D drive, and I’m going to choose Next to choose that particular operating system to work with. And from here, I get all of my System Recovery Options. There’s the Startup Repair, System Restore, System Image Recovery, the Windows Memory Diagnostic. And I would like to choose the Command Prompt. And now from here, I can execute any of the commands I need to help repair the operating system.

Let’s look at how you would get to the Command Prompt in Windows 8 or Windows 8.1. You’re presented with a similar screen when you start from the Installation Media with the language, the time, and the keyboard. We’ll click Next. And, again, you have an Install Now option and a Repair Your Computer option.

This is where the user interface is going to be a little bit different than Windows 7 or Windows Vista. You have the option to Continue, which would Exit and Continue to Windows 8, Troubleshoot or Turn Off Your PC. In our case, obviously we would like to troubleshoot. We can refresh our PC, reset our PC, or choose some advanced options.

And in this case, we would like to perform an advanced option, and one of those options is System Restore, System Image Recovery, Startup Repair. And what we would like to use is the Command Prompt.

Now that we’re at the Command Prompt, let’s do some troubleshooting. Let’s say that our problem is with the master boot record of our boot drive. This is not in a partition. It’s part of the very first sector of the boot disk. This knows all about the other partitions that are on the drive, is a master list of what is contained on that storage device.

So it’s obviously a very important part of the drive. It also knows where the active bootable partition is. So if anything goes wrong with the configuration or setup of this MBR, then we won’t be able to find really anything else that’s on our drive.

It may say that there is an error loading the operating system, there’s a missing operating system, or that there’s an invalid partition table. So what we want to be able to do is to fix the master boot record.

In Windows Vista, Windows 7, and Windows 8 and 8.1, the command is exactly the same to perform a repair of the master boot record. The command is bootrec/fixmbr, and this will fix the master boot record on the physical drive that we specify.

Let’s perform this command and see what happens. I’m going to perform a bootrec/fixmbr, and you can see instantly it comes back and says the operation has completed successfully. And we’ve now repaired the master boot record.

We might also find ourselves needing to repair a partition boot sector as well. You may see this referred to as a volume boot record. This is not the master boot record that’s on our drive. This is in a separate partition, and it’s commonly used to start the operating system that is in that particular partition.

When you see a problem with the partition boot sector, you may see a message like invalid partition table. And the way that you would repair this is to use the bootrec command again, but instead of using /fixmbr, we use the command /fixboot.

Let’s now run this command to fix the partition boot sector. I’ll run the bootrec/fixboot. And we’ll hit Enter, and you can see that it instantly comes back and says the operation has completed successfully.

When the Windows Boot Manager is starting the operating system, you usually don’t see it unless you’ve configured a menu that might select between different operating systems that you’d like to load.

If there’s a problem with this boot configuration data, then we may need to rebuild it so that it’s correct. And you would use the bootrec command and use /rebuildbcd, for boot configuration data, for it to rebuild that menu system and allow you access to the operating systems.

On my system, I have manually removed my boot configuration data so the rebuild process will have something to do. So let’s run it. Let’s run a bootrec/rebuildbcd, and it will look through my drives for Windows installations. And it has found one under D:/windows. Would I like to add that installation to a boot list? I’ll click Yes, and it says that the installation has completed successfully. Now when I restart my computer, it will be able to find my Windows operating system and start everything normally.