How to use the command line to troubleshoot boot entry problems. Using the Command Prompt to Recover a Hard Drive X sources commands

To save your computer from constant resets and restarts when booting, you need to restore the operating system (Windows) in the command line.

The Recovery Console contains most of the most commonly used system commands.

They allow you to fix the problem and get your computer working again in a matter of minutes.

First, you need to have an installation disk on hand or with the version of Windows that was installed on your PC.

Nowadays, USB drives are the most commonly used.

Using a special utility Rufus, we can create such a drive in a couple of clicks.

Like the picture below:

Our installation process will open, you need to wait until all the download files are unpacked.

After unpacking is completed, the following window will open.

Press the key in it R to open the console.

Now you need to enter the number that corresponds to the desired copy of Windows.

In most cases, only one OS is installed, click on the button 1 .

If you have a password set, you need to enter it and press Ok. Or just click Enter.

This will open the Recovery Console.

We can enter any command we are interested in in a text line.

Their full list can be obtained by writing

Help .

Fixmbr - this command will help restore the system boot partition.

To confirm any action, press the Latin letter Y and press Enter.

We write and confirm the command

Fixboot , to begin the process of burning the OS to the system disk.

After the process is completed, enter

Exit , to close an unnecessary console.

Then we restart the computer.

VIDEO: MBR recovery on Windows XP, all commands in the recovery console

Recovering MBR on Windows XP, all commands in the recovery console

Commands to restore Windows 7

We will restore our system through safe mode.

When the computer starts, press and hold the key F8 .

In rare cases, its function is taken over by a button Delete.

A boot menu will open in front of us, in which we need to select the item "Safe Mode with Command Line Support". As shown in the screenshot below:

A console will open in front of us in which we need to write the command

Rstrui.exe

It will open before us "System Restore Wizard"».

It displays a list of saved points to which we can roll back the system.

Among them there will be an automatically created point.

Select the item that interests us and click Further . The recovery process has started.

After this, reboot your .

This method works even when the system is heavily damaged by viruses. This method can be used if the OS does not load at all.

Interesting videos that will further help you understand the problem:

VIDEO: Windows won't boot? Reboot Windows 10, 8 or 7

Windows won't boot? Reboot Windows 10, 8 or 7

During startup, press the key Delete to enter the BIOS subsystem.

Finding the tab « boot» and install our media in first place.

This is done in order to boot the system from it.

While in the BIOS, remember which disk is located first in the “boot” tab. If you have two or more hard drives, the download will start from the one with no data. operating system. Put in first place the drive on which you want to install Windows.

Now press the key F10 and press the button Y in the Latin keyboard layout.

The BIOS configuration was successfully saved. After this a window will pop up "Installation Wizards"Windows8".

At the bottom of the screen we find the item "System Restore" and click on it.

From the list provided, select the desired operating system:

Now let's go to the section "Diagnostics" and enter:

Click on "Automatic recovery" and wait for the process to complete.

While in the BIOS, remember which disk is located first in the tab "boot". If you have two or more hard drives, the boot will start from the one that does not have operating system data. Place the drive you want to install on first.

Manually fixing problems

If the automatic mode is powerless, we proceed to manually eliminating bugs.

To do this, in the “ Additional parameters» select a tab "Command line".

Let's start working with the command line.

To begin, enter

Bootrec /FixMbr - to fix the boot record.

Then we write

Bootrec/FixBoot , to fix the new boot sector.

Then enter

Bootrec/ScanOS . This command will help you find previously installed versions of Windows.

And the last one -

Bootrec /RebuildBcd .

It is designed to provide information about installed OS versions in the download repository.

To complete, enter the Latin Y to confirm all our actions.

As a result, you should have a picture like this:

Now you just need to restart your computer for the changes to take effect.

If all previous actions were unsuccessful, then we will use one more method.

We launch the console using the tools designed for this Win + X.

Finding the point "Command Prompt (Administrator)" and left-click either Enter.

After this, we create a directory for our copy of Windows.

To do this, enter in the required field:

Mkdir С:\Imagen-Restaurar and press the key Enter.

Your actions will not result in any visible changes. Don't be alarmed.

These are the system settings. The console will give you a response after the manipulation is completed.

Leave the computer quiet for 20-30 minutes without performing any additional actions.

When working with the console, never put spaces between words; it is better to replace them with (hyphen). In cases with spaces, errors and unexpected failures may occur.

When the process is complete, you will see the copy you created, which will appear under the name "WITH:".

You can choose the recording path yourself. You will have two options: an external screw or another local drive.

"Imagen-Restaurar"- the name of the created folder in which our image will be stored.

So, after the process is completed, check for the presence of the file "CustomRefresh.wim".

If it is not detected, then click restart and try again.

If you specified the wrong path, you should look for the mounted image in the folder System32.

This is registered as a starting point for Windows system recovery.

WITHIt is worth creating a restore point when the operating system is in order. In the future, you can roll back the OS to the last restore point at any time.

Starting Windows 10 Recovery Mode

Reboot in Safe Mode

Before restoring, you need to make sure that there are no malicious files on the system. If a virus attack has damaged Windows, then it is worth conducting a deep scan of the entire computer.

First of all, we reboot our PC in safe mode. To do this, open the menu "Start".

Find the item and open it by clicking the left mouse button.

Now click on “Update and Security” → “Recovery” → “Special boot options”.

Finding the option "Reboot Now" and select it.

As a result of this, it will open before you.

This item gives us three actions to choose from, select a position "Diagnostics".

In the window that opens, select , and finally

From the proposed list of reboot options, we need "Enable Safe Mode."

Click on the button "Reboot."

This mode can also be selected in a short way: go to "Start", hold down the key Shift and click on the action. The screenshot describes in detail:

The same function can be set by default via the command line.

First, open it (it’s shown above exactly how) and enter just one command:

bcdedit /set (default) bootmenupolicy legacy and press Enter.

Restoring a hard drive or flash drive does not always require the use of special software; Sometimes you can fix errors using the built-in Windows utility called CHKDSK (check disk). This program will check the disk for errors and correct them if found. CHKDSK can be launched in several ways, but we will focus on the option using the command line.

Command line recovery

To perform a hard drive recovery using the CHKDSK utility, run the command line:

  1. Press Win+R and execute "cmd".
  2. Enter a command like “chkdsk E: /F /R”.

If the disk is in use by the system, the computer will reboot to complete the check. Correcting errors on a flash drive using the CHKDSK utility does not require a reboot.

Let's look at the command syntax:

  • “Chkdsk” – launch the checking utility.
  • “E:” is the letter of the hard drive or flash drive partition that needs to be checked using CHKDSK.
  • “/F” – error correction.
  • “/R” – recovery of damaged sectors.

If you don't like working with the command line, run disk check through the Windows interface:

Checking a hard drive or flash drive partition through the Windows interface is no different from this procedure on the command line. If the disk partition is in use, the system will reboot.

Windows won't boot

If the system constantly restarts due to hard drive errors or does not boot at all, then to restore the hard drive via the command line you will have to use the installation flash drive. If you have Windows XP, then run the recovery console:


If the verification utility manages to detect and eliminate errors and bad sectors, then after a reboot you will get a normally functioning system.

On Windows 7, after the first installer screen appears, you need to go to the “System Restore” section. On Windows 8.1 and Windows 10, the section is called “Diagnostics”, it has a subsection “Advanced options”. From the list of available tools, select Run Command Prompt.

At this point, many users make the mistake of entering the chkdsk command without taking into account the drive letter of the Windows installation. The problem is that in the recovery environment the letters are assigned slightly differently - “C” denotes a 100 (500) MB partition allocated for the needs of the system, and the volume with Windows files becomes “D”, etc.

To find out the exact letter, type “notepad” in the command interpreter window and press Enter. Notepad will open: expand the File menu, click Open. In the Explorer window, go to “Computer” and see what letter is assigned to the Windows file partition.

Once you know the partition letter, write it in the command syntax: for example, chkdsk D: /f. The disk check will start. If you need to scan HDD to detect bad sectors, then run chkdsk D: /f /r. When prompted that it cannot be completed, type "Y" and press Enter.

The disk scan and recovery will start. If everything was done correctly, then after completing the procedure the system will work correctly. Don't forget to disable booting from the flash drive if you set it in the BIOS, otherwise Windows will not start.

Many users personal computer are faced with the need to return the system retroactively due to their own reasons. Most often - due to damage to the computer by viruses and malware. System Restore via Command Prompt may resolve this issue. What is the point of this option? In return to operating mode, in which you can already clean your PC from viruses.

General information

Regardless of the user's advanced level, it should be remembered that restoring the system via the command line is only possible if a return point was previously set, that is, a date from which a return can be made. In Windows 7 this option is enabled automatically. About once a week (standardly on Sundays) the system creates a checkpoint. Some users disable this service as unnecessary, but in vain. If there is no point, then restoring the system via the command line will not give anything, because there will be nowhere to restore from. Reverting the system to a backward number does not affect photos, videos or documents. They are preserved in full.

Step #1

So there you have it. The first step is to turn off your computer. Then turn it on again and press the F8 key. If the computer starts in normal mode, it means you didn’t have time - do everything again. When a black window with launch options appears, feel free to select: safe mode with command line support. This is exactly what you are looking for. Next, the system will boot, many lines will run on a black background.

Step #2

When a large window appears with the words “C:/WINDOWS/system32”, you can start calling the recovery option. To do this, write the command. Immediately after the inscription, without dots, spaces or other signs - rstrui. Press "Enter". System recovery from the command line will begin. Alternatively, there is another command: “C:\WINDOWS\system32\Restore\rstrui.exe”. The short order type does not help on all versions of Windows. For example, it works differently on different editions of XP.

Step #3

In fact, the system recovery itself begins using the command line. In the first window, immediately click “Next”. It's called "Restore system files and settings." There are no options here unless early access points exist. If they are not there, an error message will pop up. It is not possible to create a point from safe mode at the moment.

Step #4

Select a target date in the window that opens. For example, a day before a disaster with your computer or any other convenient one. Once selected, click “Next”. Confirm your decision by clicking "Next". In the very last window, the system will once again clarify your decision and also warn that restoring the system via the command line or by any other method cannot be undone. That is, it will happen irrevocably. On the other hand, you can always choose an even earlier point and return the system to the desired number again. Wait until the system is completely restored, the PC will automatically reboot and open in normal mode from the date you selected.

Using a laptop or desktop PC on the Windows 7 operating system, users often encounter problems loading it, system freezes, or a blue screen. The main causes of these problems may be viruses, deletion of system files and low-quality software. To solve these problems, it is enough to use system restore points.

These restore points are designed to restore the OS to the point in time when it was worked stably. Each restore point is created automatically when there are some changes in the system. For example, when installing a driver or software.

In this material we will pay special attention command line, with which we will restore Windows 7. By restoring the OS through the console, you will significantly speed up the process. Our article will be of particular interest to novice system administrators and advanced PC users.

Running System Restore in the console when the OS boots normally

If in Windows 7 after booting there is unstable work, programs do not open, system components freeze and do not work, then in this case it is necessary roll back to the previous saved point. Let's launch the console as Administrator. To do this, go to the menu “ Start" and in the search we will type " CMD" Then right-click on the result found and select “ Run as administrator».

After these steps, the console will start in Administrator mode. In the running console window, enter the command rstrui.exe

After executing the command, the System Restore Wizard will open. Click the Next > button in the window that appears to proceed to selecting recovery points.

Let's choose suitable the restore point at which Windows 7 functioned normally and we will continue.

In the window that opens, click the Finish button and confirm the message. After confirming the message, we will start a system rollback to the selected restore point. If the restoration is successful, you will see a corresponding message.

As you can see, launching recovery through the console is not difficult at all.

Restoring via the console in safe mode

The recovery method described below is necessary if Windows 7 cannot be started in the usual way. To go to the Windows alternative boot menu, press the F8 key when the system starts (there may be other options, for example, Del or others). In this menu you need to select the item shown in the image below.

By selecting this item, the operating system will boot no GUI, and the only means through which the system can be controlled will be console. In the console window, enter the already familiar command rstrui.exe

By executing this command we will open the System Restore Wizard. Let's select a suitable access point in the wizard.

From the example it is clear that it is identical to the previous one. The only difference is the launch Windows in safe mode with console support. Typically, this method almost always works, even if the system heavily damaged by viruses, since at startup the OS loads only the main drivers and there is no access to the Internet.

Running System Restore in the console using the Windows 7 installation disc

If the second method does not help restore the system, then the only option to start recovery using the console is installation disk or boot flash drive. Let's turn on our PC and boot from installation disk Windows 7.

Now let's move directly to the console itself. To do this, click the hyperlink “ System Restore", which will start searching for installed systems.

Let's select the operating system we need and move on to the next window.

In this window, select the item “ Command line", after which it must start.

In the console, we will type the command rstrui.exe that is already familiar to us. After executing this command, the recovery wizard will start. The work of the master is identical to the examples described above. Therefore, we will skip further description of the recovery wizard.

Recovering the Windows boot record using the console

Using a PC with the Windows 7 operating system, users often encounter problems loading it and receive messages of this type when the OS starts.

Or something like that.

The main culprit for this problem is a corrupted boot record. MBR or broken boot configuration BCD. You can solve this problem using the utility Bootrec.exe. Using the commands " /FixMbr" And " /FixBoot"The utility can create a new boot entry and fix it.

To use these commands, we need to boot from the installation disk and launch the command prompt, as in the previous example. Let's use the first command " /FixMbr» utilities Bootrec.exe.

By running this command we have fixed our boot entry MBR. If this command does not help, then use the second command " /FixBoot» utilities Bootrec.exe.

By running this command we will create a new boot entry that will allow Windows 7 to start.

From the example it is clear that using Bootrec.exe in most cases, you will be able to restore or fix the boot record in Windows 7. I would also like to note that the main reasons that damage or overwrite the boot record are:

  • Changing the local disk size with the operating system using special software;
  • Installing old Windows OS on top of new ones. For example, Windows installation XP on the same PC with seven installed;
  • Third party recording boot sector, which does not support Windows. For example, linux boot loader GRUB;
  • Various viruses and malware.

By paying attention to the reasons that damage or overwrite the boot record, you can keep your PC in working order.

BCDboot utility

The Windows 7 installation disc contains another great utility that can be used to restore the OS. Let's also boot from the installation disk into the command line. Then enter the command shown below.

In our case, Windows is installed on the “E:\” drive, so we specified the path in the “ E:\windows" By running this command we will restore the configuration files BCD, as well as the bootloader file bootmgr.

By entering the bcdboot.exe command in the console, you can see a description of the utility, as well as a list of additional keys that can be used when starting it.

Console utility MBRFix

This console utility comes bundled with a multiboot disk Hiren's Boot CD.

Hiren's Boot CD this is a disk with dozens of programs that help many computer scientists and system administrators. The main task MBRFix is to restore the Windows boot loader. Disk image Hiren's Boot CD can be downloaded from the official website www.hirensbootcd.org. Booting from Hiren's Boot CD, we will be taken to its boot menu.

In this menu you need to select “ Mini Windows XP" and press Enter. By completing this action, we will download a portable version of Windows XP with the necessary utilities for diagnosing and repairing the system, including our utility MBRFix. Now let's go to " HBCD Menu» from a shortcut on the Desktop. Then in the menu " Programs"let's move on to the points " Partition/Boot/MBR/Commandline/MBRFix».

This will allow us to open the console utility MBRFix. In the console window, enter the command MBRFix.exe /drive 0 fixmbr /win7 /yes

This team will restore the boot record and bootloader, which will allow you to start Windows 7.

Use disk Hiren's Boot CD with utility MBRFix It’s especially convenient if you don’t have the original disk with the seven.

Let's sum it up

In this material, we tried to look at all the ways to restore Windows 7 using the command line. Therefore, after reading this article, you can easily restore the functionality of your computer running Windows 7.

I would also like to note that if the OS system files are severely damaged or erased, then it will not be possible to restore the system or its boot loader. Therefore, if this is exactly the case for you, then make a backup all important information on the hard drive and reinstall Windows.

We hope that our material will help you restore your system or its boot record, and will also allow you to avoid similar problems in the future or quickly solve them.

Video on the topic

First, let's remember what restoring the operating system through the command line and not necessarily windows 10 gives us, and why this method should be used. Considering that until the last successful configuration is not done for Have a good mood, but to restore the operation of the machine. It happens that when you start Windows, an endless reset and restart begins, or you see a banner on the entire screen asking you to pay a fine or tax, an update or driver installation was unsuccessful - the list goes on. It is in the above situations that “Safe_mode_with_command_line_support” is required, through which we can. I would like to start not with the process of returning our OS to life itself, but with the fact that there is something to revive from - a recovery point.

Return point from recovery environment

Since we are talking about cmd, we will talk about the possibilities of creating via the command line - this is not the only way. Before you start creating a complete copy of the system partition with all its contents - our working version of Windows, you need to restart the person’s computer using the following method:

  • “Start” → Hold and click on “Restart”

  • In the window that appears, select “Troubleshooting”

  • "Extra options"

If you have a password set when logging in and there are more than one accounts, an additional 1 to 2 screens will appear before loading cmd:

  1. Asking you to select an account
  2. Field for entering a password, if it is set in the account
  • "Command line"

Let's enter the commands in order to make the copy correctly.


Windows 10 has a useful utility - “dism.exe”, which creates an image of Windows and restores the system using the command line, follow the instructions:

Type:

dism /Capture-Image /ImageFile:D:\Win10refr.wim /CaptureDir:E:\ /Name:”Windows 10”

Be patient, the backup copy will be ready.

With this backup created, exit system recovery mode.

Windows backup

You can create a restore point from the command line in Windows 10 itself; to do this, we need to launch the console using hotkeys, follow the instructions:

  • + [X] → “Command Line (Administrator)” → OK

Now we will create a directory for a copy of Windows, enter:

  • “mkdir C:\Imagen-Restaurar” and press [enter]

Nothing will happen after entering - the console will return a response only as a result of completion. Therefore, for 20 to 30 years, avoid any manipulation with the computer.

I would like to note that in order to avoid mistakes, do not put spaces between words, replace “-”; Do not under any circumstances change the names of directories to avoid failure.

Here, “C:” - there will be a copy - choose the recording path yourself, be it an external screw, or another local disk. And “Imagen-Restaurar” is the name of the folder. After the successful completion message appears, make sure “CustomRefresh.wim” is in place; if it is not there, restart and try again.

Launch system recovery from the console

Via the command line, there are two ways to restore the Windows 10 system.

Important! If Windows crashed due to a virus attack, first go to “Safe_mode” (safe mode) and conduct a deep analysis with an antivirus.

  1. If safe_mode is available with the console, press .
  • Enter: “rstrui.exe” → “System_Restore” → item “Restore_an_earlier_computer_state”.

Remember that after recovery you can’t change anything, only after a full recovery you can choose another version that is available.

  1. Depending on where the copy of Windows was recorded, this media must be inserted into the computer and then step by step:
  • Start" → Hold and left click "Restart"
  • Next “Troubleshooting”