Internet Windows Android

How to use the command line to fix problems with boot entries.

Hello, dear readers of the blog In my articles, I quite often mentioned such a thing as the command line. Although today this component in operating systems has lost its original meaning, but the solution of certain problems is not complete without command line. Therefore, I bring to your attention an article about what is command prompt and how to run command prompt in windows 7 and xp.

First, let's define what a command line is.

The command line is a text interface between the operating system and the user, in which commands are given by entering commands (text strings) from the keyboard. The command line is also called the console.

Today, operating systems use more of a graphical or menu-based interface. The command line is used when the problem cannot be solved using the graphical interface or the task will take longer to solve.

Fig 1. Command line.

Using the command line has both advantages and disadvantages. The advantages include:

- call commands by pressing a small number of keys;

- the command line allows you to manage programs that do not have a graphical interface;

- access to commands almost instantly (since there is no need to open a graphical interface to run the necessary file).

The main disadvantage of the command line (which contributed to the decline in popularity) is that the console interface is not user friendly, since the commands need to be taught, or each time a hint needs to be used.

How to Run Command Prompt in Windows 7 and Windows XP Operating Systems

The console startup process is similar for the two operating systems. You must press the key combination " Win + R». The “Run” window will open in this window, write the command “cmd” and press “Enter”. Windows “Command Prompt” will open in normal account mode.

The command line executable is located at

C:WINDOWSsystem32

and is called cmd .exe .

To find out with list of all available commands for the command line you need to write the command “ help” in the console and press “ Enter”. Help will appear with a list of commands used.

Fig 2. List of all available commands for the command line.

Run command prompt with administrator rights.

Since a non-administrator user has limited options when using the command line, sometimes the console needs to be launched on behalf of the administrator. To do this, open “Start”>“All Programs”>“Accessories” and right-click on “Command Prompt”.

The built-in System Restore tool in Windows allows you to fix most problems with your computer. However, very often problems have to be solved manually, for example, when the operating system does not boot. In these cases, you can use a utility called Bootrec.exe. It can help troubleshoot and fix data such as the master boot record (MBR), boot sector, or boot configuration file (BCD).

Whether you're using Windows 7 or Windows 8.1, if your operating system won't boot and Startup Repair can't fix the problem, you should try the Bootrec.exe tool.

This tool is operated from the command line. However, since you're having trouble loading your operating system, it's obvious that you won't be able to run Bootrec.exe directly on Windows.

If you have Windows 7, then you need to boot using the installation media or a system recovery disc.

To boot from a DVD or USB, the appropriate device must be the first device in the partition. « FirstBootDevice» in BIOS. Depending on the manufacturer motherboard and BIOS versions, this section may be called somewhat differently.

If the boot process from installation disk successful, select your preferred language and click Next. In the next window, click on the "System Restore" link.

Then select the operating system you want to restore. This is an important step when you have multiple operating systems installed and only one is damaged. Click "Next" to continue.

In the window that opens, you will see all the system recovery options, but in this case we are only interested in the command line.

If you do not have an installation Windows disk 7 or the system recovery disc, you can access the system recovery options with hidden section recovery that Windows 7 automatically creates during the installation of the operating system. To learn how to do this, see "How to run System Restore using additional options downloads in Windows 7.

If you are using Windows 8 or Windows 8.1, follow the steps in the third, fourth, or fifth sections of this guide: . Depending on the method you choose to boot your system, you can launch the command prompt either from advanced options or from the safe mode interface.

Now that the command prompt is up, type the command and press Enter to see all the options that are available for this tool. As the screenshot below suggests, there are four options in total: /FixMbr, /FixBoot, /ScanOs and /RebuildBcd.

Later in this article, I'll explain how each of these options can help you resolve download issues. Bootrec.exe can fix most problems, but it doesn't guarantee success in all scenarios, so keep that in mind.

How to repair Master Boot Record (MBR)

The first parameter of Bootrec.exe is /FixMbr. It allows you to repair a corrupted Master Boot Record (MBR). The Master Boot Record is the first sector of the disk and it tells the BIOS where to look for the operating system on the computer.

In general, this option should be used when you encounter one of these error messages: "Operating system not found" ("Operating System not found”), “Error loading operating system”, “Missing operating system” or "Invalid partition table".

To start the MBR recovery process, run the command bootrec.exe /fixmbr.

How to write a new boot sector

The /FixBoot option writes a new boot sector to system partition. The tool will use a boot sector that is compatible with your version of Windows. Using this option can help in the following situations:

  • boot sector has been replaced with a non-standard one for Windows Vista, 7, 8 or 8.1 boot sector;
  • the boot sector is corrupted;
  • an earlier version of Windows was installed after installing your operating system.

To write a new boot sector, use the command bootrec.exe /fixboot.

How to recover Boot Configuration Data (BCD)

Boot Configuration Data (BCD) contains a detailed list of what should be loaded at system startup. Microsoft indicates that the download error can also be caused by missing or corrupted files in BCD. The /rebuildbcd option can be very useful when you need to fix errors by full recovery BCD.

To completely restore Boot Configuration Data, run the following command: bootrec.exe /rebuildbcd.

How to Add Missing Windows Installations to Boot Configuration Data

If you have multiple operating systems installed on your computer, but not all of them are available, use the /ScanOS option (command bootrec.exe /scanos) so that bootrec.exe "scrambles" all disks for the presence of any installed versions Windows that are not included in the Boot Configuration Data (BCD).

In the screenshot below, you can see what this scanning process looks like.

If the bootrec.exe /scanos command returns results, you can continue with the recovery process to get back the "lost" Windows installation back to a secure BCD table, making it bootable again.

First, you must clear the Master Boot Record (MBR) with bootrec /fixmbr. Then type bootsect.exe /nt60 all /force and press Enter. Parameter /nt60 uses a BOOTMGR compatible master boot code. Parameter /all updates the master boot code on all partitions. The /force option forces the volume(s) offline during the boot code update.

By running all these commands, you will create a new Master Boot Record (MBR) that will use the correct Windows bootloader to run that particular operating system from your drive.

If you have any questions feel free to leave a comment.

Have a great day!

By entering commands into "Command line" in operating systems The Windows family can solve a variety of tasks, including those that cannot be solved through a graphical interface or are much more difficult to do. Let's see how in Windows 7 you can open this tool in various ways.

Interface "Command line" is an application that provides the relationship between the user and the OS in textual form. The executable file for this program is CMD.EXE. In Windows 7, there are quite a few ways to call the specified tool. Let's find out more about them.

Method 1: Run window

One of the most popular and simple ways call "Command line" is to use windows "Run".


The main disadvantages of this method is that not all users are accustomed to keeping in mind various combinations hotkeys and launch commands, as well as the fact that in this way it is impossible to activate on behalf of the administrator.

Method 2: Start Menu

Both of these problems are solved by launching through the menu "Start". Using this method, it is not necessary to keep in mind various combinations and commands, and you can also launch the program of interest to us on behalf of the administrator.


Method 3: Using Search

The application we need, including on behalf of the administrator, can also be activated using the search.


Method 4: Running the executable directly

As you remember, we talked about launching the interface "Command line" is done using the executable file CMD.EXE. From this we can conclude that it is possible to launch the program by activating given file by going to its location directory with Windows Explorer.


At the same time, it is not at all necessary to use the address bar to go to the CMD.EXE location directory in Explorer. Moving can also be done using the navigation menu located in Windows 7 on the left side of the window, but, of course, taking into account the address that was indicated above.

Method 5: File Explorer Address Bar


Thus, you don’t even have to look for CMD.EXE in Explorer. But the main drawback is that this method does not provide activation on behalf of the administrator.

Method 6: launch for a specific folder

There is a rather interesting activation option "Command line" for a specific folder, but, unfortunately, most users do not know about it.


Method 7: forming a label

There is an option to activate the "Command Line" by first creating a shortcut on the desktop that refers to CMD.EXE.

  1. Click PKM anywhere on the desktop. In the context list, stop the selection on "Create". In the additional list, go to "Label".
  2. The Create Shortcut window will open. Click on the button "Review…" to specify the path to the executable.
  3. A small window opens, where you should go to the CMD.EXE location directory at the address that was already agreed upon earlier. Select CMD.EXE and press OK.
  4. Once the object's address is displayed in the create shortcut window, click "Further".
  5. In the field of the next window, a name is assigned to the shortcut. By default, it corresponds to the name of the selected file, that is, in our case cmd.exe. This name can be left as it is, but you can also change it by entering any other name. The main thing is that by looking at this name, you understand what exactly this shortcut is responsible for launching. For example, you can enter the expression "Command line". Once the name has been entered, press "Ready".
  6. The shortcut will be generated and displayed on the desktop. To launch the tool, just double-click on it. paintwork.

    If you want to activate on behalf of the administrator, then you should click on the shortcut PKM and select from the list "Run as administrator".

    As you can see, to activate "Command line" using the shortcut, you will have to tinker a little once, but in the future, when the shortcut has already been created, this option activating the CMD.EXE file will be the fastest and easiest of all the above methods. In doing so, it will allow you to run the tool, as in normal mode, and on behalf of the administrator.

There are quite a few launch options. "Command line" in Windows 7. Some of them support administrator activation, while others do not. In addition, it is possible to launch this instrument for a specific folder. The best option to always be able to quickly launch CMD.EXE, including as an administrator, is to create a shortcut on the desktop.

Repair tools Windows errors constantly improving, offering users more and more automated solutions to quickly resolve various problems. If connected to a computer installation media and in the "System Restore" section, select the "Startup Repair" item, then you can fix many errors that interfere Windows startup. However, if the bootloader is damaged, this method will not work, so if you encounter such a problem, you will have to restore the MBR through the command line.

Command line launch

You will need boot disk with the distribution kit of the same system that is installed on the computer. Not only the version must match, but also the bit depth of Windows, otherwise the recovery will not work.

After opening the list of available tools, first fix launch errors. If you can't resolve the bootloader corruption issue, return to the list of tools again and select Command Prompt.

Bootrec utility

To overwrite the MBR (data required to boot Windows) and fix bootloader errors, we will use the built-in Windows utility. Enter the command "bootrec" in the interpreter window. After running this utility, a list of supported commands will appear - run them in order.


Restart your computer. The bootloader repair is done, the MBR is overwritten, so Windows should start without problems. If overwriting the MBR did not resolve the startup issue, try the remaining two commands:


The utility will start scanning hard drive trying to find installed systems. When Windows 7 is detected, run "Bootrec.exe /RebuildBcd". The systems found will be written to the boot menu. Exit the utility using the "exit" command and restart your computer. You no longer need to overwrite the MBR - Windows will start without errors.

BCDboot utility

If you can't fix the MBR error, try repairing the bootloader using the BCDboot utility. This tool allows you to create or restore a boot environment located on the active partition of the hard drive. If, as a result of a system failure, the boot environment was moved to another hard section disk, then using BCDboot.exe you will return it to its place.

Open a command prompt and type "bcdboot.exe e:\windows" (attributes are optional). Instead of "E:" you need to put the letter of the partition on which the Windows files. If in Windows environment this section is marked with the letter "C", then here it can be displayed as "D" - keep this in mind when executing the command.