If you have a Windows computer that won’t boot, you may still be able to manage the OS through the Windows Recovery Console or the Windows Command Prompt. In this video, you’ll learn about these recovery tools and some commands that can help get your system running when all else fails.
<< Previous Video: Operating System Command Line ToolsNext: Using Computer Management >>
The Windows Recovery Console, later called the Windows Command Prompt in Windows Vista and Windows 7, is a very, very powerful troubleshooting tool. It allows you to go right on to the operating system and change things in the file system without actually starting Windows. Also keep in mind that this means it is incredibly dangerous to go into that command line and start making changes to the operating system down at the OS level. You should only be using the recovery console or the command prompt if this is a last-ditch effort to solve some type of problem on your system.
One advantage this gives you, of course, is that you have complete control. You can now get into the operating system before it starts and make any changes you’d like. If you’re having problems booting your system or you’d like to make it change to the operating system before it starts up, this is exactly the place you should go.
You can think about the command prompt or the Windows recovery console as being able to do things like copying or changing files that are part of system files and folders. You can enable or disable services. You can fix boot sectors and change the Master Boot Record before your system really gets started. And you can even change the partitioning, the formatting, and modify things right at the drive level.
If you didn’t want to have to use your Windows XP installation media every time you wanted to run the recovery console, you could install it permanently on your system by grabbing the installation media and running this program. You would reference your CD-ROM drive that had Windows XP. In the i386 directory you would run winnt32.exe and use /cmdcons to install the recovery console onto your Windows XP system.
In Windows Vista you would use the repair utilities under the system recovery options to go to the command prompt. And you need your Windows Vista installation media to be able to do that.
In Windows 7 it’s a similar process. It’s almost exactly in the same place if you’re using your Windows installation media. You can also choose from the Advanced Boot Menu when you press F8 to start your system to run your repair utilities from there. That will only work if you have that 100 megabyte recovery partition that’s built into Windows 7. And if you’re installing Windows 7 from scratch you’ll notice it adds that 100 megabyte partition automatically. If you don’t have that partition then you will need to boot from your Windows 7 installation media.
You often need to use these recovery options when you’re not able to boot your system. And one of the problems you can have when you’re booting your system is a problem with the Master Boot Record.
The Master Boot Record is the very first sector on a physical disk. This is exactly where your computer goes before it starts loading anything from your storage media. So this isn’t in one of your partitions. This is outside all of the partitions on your system.
But the Master Boot Record knows about all of those partitions that you’ve configured on that particular drive. It is the master list. It is your Master Boot Record. It knows also where the active bootable partition happens to be. That is also called the volume boot record. We’ll talk about that in a moment. So that when the Master Boot Record looks at everything on your disk it knows exactly where to go to hit the boot sector for your operating system so that things can start up normally.
If you run into problems with the Master Boot Record you’ll see messages on the screen like, there’s an error loading the operating system. Or, missing operating system. Or, invalid partition table. All of these problems could point to a problem with your Master Boot Record.
So how would you fix the MBR? Well in Windows XP you need to start the Windows Recovery Console. Once you’re inside of the console you may want to run something like the MAP command and that would list out all of the physical drives that are on your computer. From there, you can use the command FIXMBR and then if you wanted to, you could even specify a particular device name that was listed in that MAP command. If you just simply use FIXMBR by itself, it will use whatever device is set as the boot device.
With Windows XP we would boot from the boot CD, the installation CD, for our Windows XP system. It’s going to run through it’s normal process of loading drivers. And we’ve seen this before when we went through the installation process for Windows XP. It’s exactly the same process all the way up until we get to the very first prompt that deals with installing Windows XP.
And at that point in our installation program to set up Windows XP we would have pressed enter. But in this case we’re going to repair a Windows XP installation by using the recovery console. So instead we would press R.
When we press R it goes through a process of checking our keyboard. And then tells us about all of the Windows installations on the computer. It says there is one called C colon backslash WINDOWS. If there were other Windows installations it would show us those as well.
And then it gives us a prompt that says which Windows installation would you like to log into? And I would like to log in to, number one, the C colon backslash WINDOWS which is my only prompt in this case. It wants the administrator password.
And this is an important consideration. We need to make sure we have the password for our system. So we need to put in that administrator password. And if you’ve got it right you get a C colon backslash WINDOWS prompt.
You’re now at the Windows directory of this computer. If I type dir here are the files that are on this computer. And now I’m able to modify those and make changes before I even start the operating system.
In this case, let’s say we wanted to fix the Master Boot Record. Before I do that I want to look at all of the physical drives on this computer. I use the map command. And it tells us there are two. There’s an NTFS drive. And you can see it’s called backslash Device backslash Harddisk0 backslash Partition1. There’s also a D drive that’s my CD-ROM. And its device name is backslash Device backslash CdRom0.
What we’re going to do is a FIXMBR. And before I do this I’m going to do a question mark, a slash question mark so you can see more about this particular command. An important consideration is that we’re now going to make changes to the Master Boot Record and that will affect everything on that physical drive potentially. We want to be sure, if we have a way to back this system up, that we do it right now. If we make a change it is entirely possible that whatever change we make may render any operating systems on this computer inaccessible. And we don’t want to have a problem where we’re losing user’s data.
What we’re going to now run is FIXMBR by itself. I could also, of course, choose those device names by specifying device. I could specify hard disk zero. And then partition one. If there were different drives that I wanted to perform that fix on for the Master Boot Record.
If I hit Enter it says, this computer appears to be non-standard or invalid Master Boot Record. And then my particular configuration, my MBR is a little bit different because of the virtual box system that are running in this virtualization environment. And it says, are you sure you want to write a new MBR. I’m going to Y to say yes. And a new Master Boot Record has been successfully written.
Now when we restart your system it’s going to use this brand new MBR to get everything else running on your computer. If you’re running Windows Vista or Windows 7, the process for recovering the Master Boot Record is a little bit different, although the concept is exactly the same. The command is different, however. It’s called BOOTREC for boot recover slash FIXMBR. So there’s a little bit of difference there in what you use it the command line, but what you’re doing to the Master Boot Record is exactly the same.
Let’s run through this recovery process in Windows 7. Before the operating system had a chance to load I pressed F8 and that brought me to the advanced Boot Options menu. You can see at the very top I have an option to repair my computer. And the reason that’s there is that I have that 100 megabyte system partition that was created during the Windows 7 start up and so all of the repair functions are on that 100 megabyte partition. If I didn’t have that partition again I would need my Windows 7 installation DVD and I would boot from that to get to this repair option.
In this case, I’m going to choose repair my computer. And we’re going to load up all of those repair options that might be available or need to be used for this operating system.
The first prompt you get then is for the system recovery options. And you can see it asks for a keyboard input method. The only option that I would like to use in my case is US, but if you’re in another country you would choose the keyboard that’s appropriate for you. I’ll click Next.
And it says you need to log in as a local user. And I want to get to the command prompt I’m going to need to log in, not only as a normal user, but the administrator user as well. So you’ll need to add your password for that administrator user.
And you get all of these different recovery tools. You get start up prepare, system restore, system image recovery, Windows memory diagnostic– that can be pretty useful. And right here is our command prompt. And if I click that I am now at a command prompt for Windows. This looks very similar to any other command prompt in the Windows operating system, although the number of options available to me is not quite as many as when I’m running a full-blown operating system. This is built just for recovering.
Before I run the BOOTREC command I’m going to use a command that we used in one of our earlier videos to list out all of the physical drives that are on this system. So I’m going to use disk part to go into the disk part program. And it tells me what computer I happen to be in and how it’s configured.
And there I am of the disk part prompt. And I can use a list command. And if I use a question mark I can list disk, I can list partition. I can list a volume or a virtual disk. In my case, I want to see what disks are available. There’s only one on this particular computer. I could also a list volume to give you an idea of that since we’re only dealing with the MBR, we’re really talking about what the MBR is for this disk zero. There’s no other disks in my computer so I really can’t mess up this MBR program by specifying the wrong disk. That’s the only one that happens to be there.
So let’s exit out of disk part and let’s run our bootrec program. And I want to fix the MBR. And what I do that it says the operation is completed successfully. That’s it. That’s all you have to do. Now the Master Boot Record has been overridden. We can reboot our computer and hopefully be passed that problem we had when we were trying to start it up.
There are other boot records on your computer as well, very similar to the Master Boot Record but every partition running an operating system has its own Boot Record as well. This is called the volume boot record. And really it’s designed for the individual operating system that is loaded on that very specific partition. This starts up the bootloader for that OS. So if you’re running something like Windows XP it’s going to start up the NTLDR application.
If you’re running Windows Vista or Windows 7 it runs something called the Windows Boot Manager. If you have problems with the volume Boot Record for operating system you may see errors like this like invalid partition table. If you recall, it’s very similar to the errors we saw with the Master Boot Record. It’s very common when somebody’s running into these partition problems and Master Boot Record problems that they will commonly not only fix the Master Boot Record but they’ll fix the volume boot record at the same time.
To fix the volume boot record in Windows XP we would again start the Windows Recovery Console. In this case we would choose the DISKPART command. This is a little bit different than the DISKPART command that’s in Windows Vista or Windows 7, but it certainly shows you a listing of the different partitions that are on your computer.
At that point you can run the FIXBOOT command. And this will write a new boot sector to the partition that you specify. Notice that if you leave it blank whatever you have as the local device will be the one that gets the new boot partition.
Here’s our recovery console. If I look at DISKPART it gives me a listing of all of the different partitions that are on my system. I really only have one with the drive letter on this particular computer. If I had multiple partitions and I could boot into to any of those I might have a C colon a D colon, an E colon or other drive letters as well.
This makes it very easy for me to determine which one that I’m going to fix. It’s only going to have the C colon as an option. I could even just leave the option off and it will use the default that I happen to be in because I’m at my C drive right now.
If I then perform the FIXBOOT and hit Enter it says the target partition is C colon. So it does give you an idea of what it will be updating. Do I want to write a new boot sector to the partition? Yes I do. And it says now the file system has been identified as NTFS. It’s written a new boot sector and it’s done. Just that fast.
And now when I reboot hopefully it will get past all of those problems that it had either with the MBR or the individual boot sector for the operating system.
With Windows Vista and Windows 7 we really don’t even have to remember a new command. With Windows XP we had FIXMBR FIXBOOT. But with Windows 7 we’re still using the BOOTREC command except we’re using a different option after it. We’re using BOOTREC/fixboot to write the new boot sector.
Here’s the command prompt in Windows 7. It’s the BOOTREC program again that I’m going to run. Last time we did a FIXMBR this time we’re going to perform a FIXBOOT. So it’s BOOTREC/fixboot. And it says the operation completed successfully just that easy. Now we can reboot our computer and hopefully we’ve resolved that problem with the boot sector.