Running system recovery from the command line. How to run windows repair using command line

By creating control point. This method is quite simple. But what if you run the system rollback to an earlier state? in a standard way fails? In this case it would be appropriate to use command line.

Nuances and methods of restoring the Windows 10 system via the command line

Restoring Windows 10 OS via the command line without a previously created image or distribution is impossible. Therefore, if you encounter an error that you cannot fix and you can only roll back the OS through the console, you should use an installation disk or flash drive.

If you plan to perform further Windows rollback 10 via the command line, worth creating backup image systems. To do this we do the following:

  • Open a command prompt with administrator rights. Press “Win+R” and enter “cmd”.
  • The console will open. Enter “mkdir c:\Imagen-Restaurar”, where C is the drive letter on which the storage will be stored. Windows image 10, and Imagen-Restaurar is the name of the folder with the copy.


  • Next, enter “recimg /createimage c:\Imagen-Restaurar”. This command creates the image itself and places it in the specified folder. The copy creation process may take some time and may even freeze at 1%. However, there is no need to press buttons or turn off the PC. After copying is complete, you should go to the specified folder and check for the presence of the “wim” file. If it exists, then the image was created correctly.

Now you can use the following methods to restore the system itself.

Method No. 1. Using the bootrec.exe utility

  • Enter bootrec.exe in the console. An instruction will appear describing the action of each command.
  1. FixMbr – used in cases where the boot sector hard drive damaged. By entering the command, the program will automatically correct errors and the user will be able to log into Windows 10 normal mode;
  2. Bootcfg is a command to solve problems with the missing boot.ini file. Recovery Windows performance 10 you should enter “Bootcfg/rebuild”;
  3. CD repair copy SYSTEM C:\windows\system32\config – command to fix errors with damaged config file. After entering it in the console, requests will appear on the monitor screen. You need to answer “Yes” to everything, that is, enter the letter “Y”.
  • Copy D:\i386\ntldr C:\ - command to fix the “NTLDR is missing” error, where D is the drive letter on which the system image is stored, and C is the drive with the operating system.

Method number 2. Restoring Windows 10 with a backup

If you have previously created a system restore point or have a backup Windows image 10, from which the system can obtain missing files, you should do the following:

  • Reboot your Windows 10 PC in safe mode with command line support.
  • Launch the console and enter “rstrui.exe”.
  • Will start standard recovery systems.

If it is impossible to roll back Windows 10 via the command line, you should check the integrity of the bootloader.

In Windows 10, since its very appearance, there have been a great many recovery options, for example, this is also a kind of recovery, today we will look at recovery methods using the command line, which will allow us to start Windows 10 after a system failure, virus attack or pressing the POWER button at the wrong time. And we’ll start with the simplest (well, maybe we’ll get lucky), I’ll say right away - computer repairs always start with the simplest, gradually moving on to more complex ones. Let's begin.

Method 1 (Safe Mode with Command Line Support)

We start the car by pressing POWER button(yes, yes, that same one). As soon as the splash screen appears on the screen (or the letters appear), we begin to methodically (with a frequency of 0.5-1 seconds) press the F8 key. If we are lucky and everything is not so critical, then a menu for selecting a boot option will appear on the screen. It consists of several points, but now we are only interested in “Safe Mode with Command Line Support”. Select this item by moving between them using the arrow keys. Having selected it, press ENTER.


Now, if we are even luckier, the machine will continue loading and give us Kazimir Malevich’s painting “Black Square”, but with some inscriptions. If this happens, then quickly rejoice and enter the rstrui.exe command here, after which the System Restore Wizard will start and offer to restore the system to an earlier state. We select the closest point in time, return the system to working condition and enjoy life and the newfound opportunity to play games.

Method 2 (Boot from Disk)

If everything is not so rosy and in safe mode the system categorically refuses to enter, even despite a huge piece of cheese lying near the mouse, then things are a little more complicated, then you will have to look for a disk with a sliced Windows distribution 10. Where to look? Well, in a desk drawer, downloaded from the Internet, or from the same programmer friend. Disk found? insert it into the drive and boot from it. Most often the download takes place without unnecessary problems, but sometimes the computer may ask you to press Any key, and if you don’t have time to do this, you may again see a sad message about the impossibility of the system working.

So, I’ll tell you where this mysterious Any Key is. In fact, on any keyboard it is always located inside the spacebar, so we must have time to press it. Did you make it? Great! Now we wait for the download blue screen. No, not the notorious BSOD, but just a screen with boot options in which we need to select the “Diagnostics” icon. Have you chosen? And again there are some icons, but there is no need to be afraid of them - after all, we firmly decided to raise the system ourselves, so we are not afraid and click the “Advanced options” icon, where we select the already familiar and not scary Command Line, into which we now enter several commands.

diskpart function

This is where we will begin our treatment, or rather just diagnostics for now. Enter diskpart and press the same ENTER and in general, we press ENTER after entering EVERY command. Having thus launched the diskpart utility, designed for working with disks and partitions, enter next command list volume, we need it to display information about all disks available in the system. Having received the information we need, we exit the diskpart utility by simply entering exit.

So, we are again on the command line, we have information about partitions in front of us - the result of diskpart’s work, and we see on which disk our sick Windows lives. Most often, this is drive C (although in some cases it may differ, but in this example let it be C), thus, having carried out the diagnosis, we move on to the treatment process itself, for which we will enter a few more commands, the syntax and purpose of which we will now learn about.

  • bcdboot.exe - utility that restores critical boot files, to launch it we enter bcdboot c:/windows. Upon completion of the program, our Windows 10 becomes healthy, but may not start. This is due to possible damage boot sector. So that we do not encounter such a disaster, we will now treat him - whether sick or healthy - for prevention. To restore the download we have two more useful commands, now let’s deal with them too. In general, to tell the truth, this is one team, but with different keys, and we will now consider their purpose.
  • bootrec command, launched with the fixmbr key (type bootrec/fixmbr), restores a damaged MBR, and with the fixboot key (type bootrec/fixboot), so as not to waste time on trifles, he overwrites it altogether. At this point, the restoration process can be considered complete.

Now let's repeat the entire chain of actions to restore Windows 10

  • diskpart
  • list volume
  • exit
  • bcdboot c:/windows
  • bootrec/fixmbr
  • bootrec/fixboot

Upon completion of work latest program we reboot our computer (and now at least with the RESET button) and now we are completely happy. And, as we see, there is nothing scary left in the command line. Now you can play your favorite games.

Windows Rollback helps quickly eliminate system errors that lead to unstable work XP. Typically the rollback starts at Windows environment, but if the system stops working or booting correctly, you can perform a recovery via the command line.

When do you need a Windows rollback?

Restoring Windows XP will be needed in the following cases:

  • Problems at startup.
  • Incorrect installation (removal) of programs.
  • A sharp decrease in computer performance for unknown reasons.
  • The desktop with all the shortcuts is missing.
  • Incorrect driver or system update.
  • Damage system files and registry files.
  • Infection with viruses that block entry into Windows.

In the listed cases, a rollback helps to troubleshoot problems and return Windows to a working state, but it is not the only possible solution Problems.

Running the command line

Let's consider a simpler option - Windows XP boots, but you cannot launch the system recovery tool: for example, Explorer or the Start menu does not work. To perform a rollback:

You can start the recovery directly from the Run menu, without using the command line. Press Win+R and enter "rstrui.exe". A Rollback Wizard window will appear, through which you specify the date to return Windows XP to in order to eliminate errors in its operation.

After restarting your computer, the problems should be resolved. If the problem persists, you will have to resort to using more powerful tools: for example, the recovery console, which is launched from installation media Windows XP.

Safe mode

If system errors prevent Windows XP from loading correctly, then try running recovery through safe mode with command line support.



An interpreter window will appear Windows commands. To run XP recovery, enter the command "rstrui.exe".

A wizard window will appear through which you can return the system to the saved key date when Windows was working without errors.

If after a system rollback there are errors in Windows work are not resolved, you should try to return to an even earlier state.

Restoring the system via the command line in safe mode is an irreversible process. The user's personal files will remain intact, but programs that were installed after the selected checkpoint will be deleted or will not work correctly, so they will have to be reinstalled.

First, let me remind you why you need system recovery in operating systems under windows control. Using the built-in recovery utility, you can undo changes that have been made to your computer system over time. Lately, namely:

1. Failed installation(delete) programs;

2. Installing updates to the system itself, as well as updates software installed on your computer;

3. Unsuccessful installation (removal) of drivers;

4. If your computer is infected with viruses, when the system starts, a window appears with the inscription “windows is blocked, send sms...”;

5. If it is impossible to start the task manager (again, due to virus infection)

And other problems starting Windows.

If you have difficulty starting your computer in normal mode, you can start the recovery from the command line via special regime, which is called "Safe Mode with Command Line Support". In operating systems windows families(especially in latest versions- windows 7, windows 8) recovery is possible only from account administrator.

Now let's move on directly to how to start recovery using the command line:

1) When loading operating system(before the welcome window appears) you need to press F8. The window for selecting auxiliary windows utilities. Select "SAFE MODE WITH COMMAND LINE SUPPORT". (Please note that in the selection of items there is a simple “Safe” mode (or in other words Safe Mode), and there is a slightly “advanced” one - “Safe Mode with Command Line Support” - be careful, you need to select this one. That’s why the mode is called safe, which allows you to decide various problems. Launch in safe mode Windows systems runs with a very limited set of files and drivers, also not produced automatic start programs (this means that those programs that start first during normal starting windows, cannot be launched through safe mode), otherwise it is installed standard set drivers that are only needed to start Windows).

2) At the command line, enter

X:WINDOWSsystem32Restorerstrui.exe

(where X is the drive where the system itself is installed) and press Enter.

3) The “System Restore” window will open, where you select the “Restore your computer to an earlier state” option.

4) If all the above points are performed correctly, the system will launch more than earlier version the saved registry on the computer (provided, of course, that you yourself did not disable system restore in the system settings, otherwise this command will be useless).

5) If your computer has been infected with viruses, then restoring the system will not get rid of them 100 percent. You will need to scan (by selecting “Safe Mode” when booting the system) all disks with an antivirus program (the choice of antivirus program is yours).

We must remember that starting system recovery through safe mode is an irreversible process. Changes made during the recovery process cannot be undone. If the recovery process does not satisfy you, then you will only have the opportunity to launch ANOTHER RESTORE POINT, provided, of course, if it exists.