How to use the command line wines 10. The easiest way to restore. Windows activation check

  • 16.12.2020

The command line is a standard operating system tool that is used to enter commands. The specificity of the console allows you to launch the recovery tool, both from the user interface and from a damaged system.

Making a copy of the system

It is impossible to restore Windows 10 without the foundation, which is a user-created image (serviceable) or system distribution kit.

Since the topic of the article is about rollback via the console, we will use the option of creating an OS image using the command line.

To enter the console, you can use the internal system search or the window that is invoked by pressing the WIN + R keys. Enter cmd:

In order to create a folder for storing Windows 10, enter mkdir c: \\ Imagen-Restaurar. Where:

  • Drive C is the storage location for the copy folder. User-defined manually. The command allows you to write a copy not only on your hard drive, but also on an external device. To do this, it is enough to keep the letter designation of the flash drive / disk;
  • Imagen-Restaurar - the name of the folder that contains the image.

Comment. After entering this command, the console will not sound any signals, but the folder will be created. To be on the safe side, check the disk.

The recimg / createimage c: \\ Imagen-Restaurar command creates the image itself and places it in the specified folder.

After entering the command, the Windows 10 backup procedure is initiated, which lasts an average of 20-25 minutes. It is recommended not to work with the computer during this time. At the end of the process, a characteristic inscription will appear in the console stating that the recovery image was successfully created and registered.

Several nuances when working with the command line in Windows:

  • Do not use a space to separate words, do it with a dash (-);
  • During copy recording, the process may hang for a long time at the value of 1%. This is normal;
  • It is strongly discouraged to change the name of the standard folder, since during the rollback of Windows 10, the image is searched for in specific places;
  • As soon as the copying process is over, go to the specified path and check the presence of the CustomRefresh.wim file in the folder. If not, then copying was unsuccessful.

Restoring Windows 10 using the command line

Despite the fact that the console is a manual recovery method, no special knowledge is needed to carry out the procedure, since the meaning of all commands is written in Russian.

Before starting a rollback, you should insert a disk or flash drive with a copy / distribution kit and boot from this device. An action selection window will appear, in which you need to click on diagnostics and then go to the additional parameters section:

In the additional settings section, select the command line launch:

After this action, a console will appear, into which you can enter bootrec.exe. The line will give a list of all possible commands with their detailed description:

The teams solve the following problems:

  • FixMbr (alternative to fixboot) - used when the boot sector of the system HDD is damaged by malware. By entering the command, the system will automatically fix these problems, and the user will be able to log into Windows 10 in normal mode;
  • Bootcfg is intended to solve the problem when the boot.ini file is missing. To restore functionality, you must enter a command with the rebuild attribute. The result is Bootcfg / rebuild;
  • CD repair copy SYSTEM C: \\ windows \\ system32 \\ config - is used when the config file is damaged in the system. After entering the command, prompts will be displayed in the console. We answer all yes, by pressing the Y key ;
  • Copy J: \\ i386 \\ ntldr С :\ - fixes the error "NTLDR is missing", which is associated with the absence of system files. J is the letter of the drive containing the image or distribution. C - the disk where the system is stored on the computer.

Comment. Each system is individual to some extent, so the user must know exactly the drive letter of his computer.

Viruses, beta-versions of drivers, crooked patches, all of this, as well as much more (do not forget about the human factor) can lead to a situation where Windows 10 won't start or is unstable... Plus, the latest operating system Windows 10 is unstable by itself due to the "dampness" of the program code. It would seem the easiest way to clean installation with saving user data, but on computers of accountants or, for example, users working with specific software - this procedure is very laborious and impractical.
In order not to reinstall the system again, you can use Windows 10 recovery from the command line.
There are several ways to restore Windows 10, from starting from under the automatic maintenance graphical interface to working with the command line in the advanced system boot options menu. Let's start from a simple way that you can use in the case when Windows 10 boots successfully, but is unstable: the start menu disappears or other interface components.

Return Start Button to Windows 10

By the way, the following command entered into the PowerShell run window will help to return the Start button: Get-AppXPackage -AllUsers | Foreach (Add-AppxPackage -DisableDevelopmentMode -Register "$ ($ _. InstallLocation) \\ AppXManifest.xml")Run Powershell with administrator rights.

Recover Windows 10 using automatic maintenance

Restoring Windows 10 using the automatic maintenance utility available on the Security and Maintenance tab is probably the easiest way to get rid of glitches and minor glitches in the OS.

In the search box on the taskbar, enter security and maintenance, and then select Security and Maintenance Center.

In the search box on the taskbar, enter "security and maintenance"

Or use the hot shortcut Win
+ Pause. The "System" window will open with a link "Security and Maintenance" in the lower left corner.

Control Panel -\u003e System and Security -\u003e System, or Win + Pause

We open the "Service" tab and click on "Start service"

We are waiting for the results of automatic system error correction.

Restoring Windows 10 from the command line

The next way to restore the system to work is windows 10 recovery from command line by checking the integrity of system files. Restore missing or damaged system files using the System File Checker tool is done by calling the command sfc / scannow


Search enter "command line" or cmd, right click command line and click on the line "Run as administrator". The search box in Windows 10 can be invoked with the keyboard shortcut Win + S

In the command prompt window enter sfc / scannow and press Enter.

Wait for the results of the system file restore operation.

If restoring Windows 10 from the command line didn't work

Error: Resource Protection found corrupted files but cannot repair some of them

This error indicates that windows 10 original component store is corrupted and sfc cannot recover the system. In this situation, you first need to restore the store of original components itself, and then re-enter the sfc command.

To restore the Component Store, you need DISM - Windows Image Servicing System. In the command prompt window, enter:
Dism / Online / Cleanup-Image / ScanHealth


The message should appear: "The component store needs to be restored." Now you can start repairing the storage. We enter the command:
DISM / Online / Cleanup-Image / RestoreHealth

When the above command is executed, the component store will be restored using the DISM tool using to get the missing files - windows update... Naturally, the Update Center service must be enabled. If everything went smoothly, you will see a message: “Recovery was successful. Component store corruption has been fixed. "

Note: A similar command to restore the Windows 10 Component Store is available from Powershell. Open Powershell (Win + S then type Powershell) with administrator rights and enter the following:
Repair-WindowsImage -Online -RestoreHealth

Now that the component store is repaired to restore Windows 10 itself, you need to re-enter the command sfc / scannow.

Repairing Windows 10 Boot When It Won't Start

But what to do in the case when Windows 10 won't start? To restore this OS, you need to boot from a previously created disk (bootable flash drive) with Windows 10 and when the window for selecting the language, the format of the input method appears, press the key combination Sfift + F10, thereby calling the command line window.

When this window appears, press Shift + F10

Command line window called by the magic combination Shift + F10

Due to certain peculiarities of the system, the drive letters in the Recovery Console may differ from the usual assignment in Windows Explorer. To find out what letter is currently assigned to the drive on which the Windows \\ directory is located, you can use the Notepad command. Notepad will open. In the notebook menu, select "File" -\u003e "Open". An explorer will appear with a list of drives with the letters assigned to them. By opening each one in turn, you can view their contents and find the system one. You can also use cd and dir commands to navigate drives from the command line.

After the drive letter with the Windows \\ folder becomes known (for example, this is the letter D), enter the following into the command prompt window:
sfc / scannow / offbootdir \u003d D: \\ / offwindir \u003d D: \\ Windows

offbootdir \u003d D: \\ partition containing the WinSxS folder with the storage of original Windows components

offwindir \u003d D: \\ Windows - the partition with the installed operating system.

Hello everyone! People, in this publication we will continue to talk about windows 10 recovery via the command line. I know that many users do not like to tinker with manually entering various combinations, but practice shows that these methods are the most effective.

Again, perhaps someone will think, they say, why bother so much, if you can just reinstall the damaged operating system and everything will be in chocolate. I agree, but what should I do if a problem occurs on my office computer?

Indeed, on such machines, various departmental programs are often installed, the cost of which sometimes exceeds the price tag of the PC itself. Here you involuntarily start to think, especially when the system, in general, refuses to start.

So, comrades, let's move on to a detailed description of another very effective method for restoring system files, which can help even in cases of a complete system crash, that is, when it does not start.

By the way, for a better understanding of some of the parameters below, I strongly recommend that you familiarize yourself with some of the previous materials on this topic, since this will greatly facilitate understanding of the essence. Here they are:

Well, let's get started. To do this, we need a bootable Windows 10 flash drive or an installation disc. We expose the initial boot from this media to BIOS and start the operating system installation environment.

Then, at the stage with the choice of language, press the key combination "Shift + F10" on the keyboard to call the command line:

And in it, open a regular notepad:

Notepad

Why do we need it? It's simple. Look, now we need to find out the exact letter of the system partition on which the faulty Windows 10 is installed. The nuance is that in the running installation environment, its letter may shift, that is, it may not be « C « , as is customary in normal operation. Therefore, we follow the path "File-Open":

Then we indicate "All files" and go to the tab "This computer". In the window that opens, you need to view the contents of the logical partitions of the hard disk of the computer and find the system one in the corresponding folders. In our case it is « D « :

How did I get it? Here are its contents:

After that, close notepad and enter a combination in the command line that will start checking and restoring the integrity of system files. It :

Sfc / scannow / offbootdir \u003d D: \\ / offwindir \u003d D: \\ Windows

Where "offbootdir \u003d D" is the disk partition on which the backup storage with operating system components is located. Let me remind you that in Win 10, this is the C: Windows \\ WinSxS directory by default.

And "offwindir \u003d D", the partition with the installed system. That is, in our case, it is the same letter. As you can see, here the main thing understand the essence and there will be no problems in the future. Now the scanning process will begin, which will take some time.

And if the backup storage is not damaged, this operation will succeed. But if errors like "Windows Resource Protection cannot perform the requested operation" fall in, then the component store itself is also violated, which makes it impossible to restore with its help.

But don't despair, we have a backup plan for that. After all, what prevents us from specifying the path to the backup files that are on the bootable USB flash drive or installation disk? Do you get the essence?

To do this, you need to create a folder for temporary storage of Windows 10 components from the installation distribution on any logical (most important, not system) partition. This can be done, again, using the same notepad. In my case, a folder was created with the name « WinTemp « in section « E « :

Then we enter the following command with our hands:

Dism / image: D: \\ / Cleanup-Image / RestoreHealth / Source: F: \\ sources \\ install. esd / ScratchDir: E: \\ WinTemp

Where "D" is the partition with the installed system (inoperable). "F", the letter under which the bootable USB flash drive or disk with the Windows image appears. "E" section with newly created folder « WinTemp « for temporary files.

If your installation image contains the file “install. wim "instead of" install. esd ", you need to change the corresponding fragment:

Dism / image: D: \\ / Cleanup-Image / RestoreHealth / Source: F: \\ sources \\ install. wim / ScratchDir: E: \\ WinTemp

If someone does not understand now what is at stake, go back to the beginning of this article and re-read the previous publications, links to which are provided as recommended. Well, we seem to have a victory this time:

From the screenshot above, we can conclude that Windows 10 recovery via the command line using a USB drive or disk was successful. All that remains is to run the SFC. And here it is worth repeating that the method described in the article is recommended to be used in the most severe cases, when the system does not even boot.

At this point, the publication comes to an end. If you still have any questions, ask them in the comments. Instead of discussing your problems and looking for solutions. And in conclusion, as always, I suggest watching another interesting video.

The new Windows 10 operating system from Microsoft has already gained popularity among millions of PC users around the world. But like all new products, Windows 10 is not without its flaws. Many users of this OS have bootloader problems... Most often, this problem occurs due to a new operating system update policy.

Now in Windows 10, you cannot turn off updates, as it was in Windows 7 and XP.

The problem with the bootloader itself manifests itself when the user does not wait for the end of the system update and turns it off the POWER button.

After the user turns on the computer again, he sees such a message on his monitor screen.

This message indicates that your bootloader is damaged and should be restored. It is also worth noting that shutting down the computer during the update is not the only reason for the breakdown. The bootloader can still be damaged viruses and various malware... Still quite common reasons for its breakdown are faulty HDDswhich are broken sectors, that is, the boot record will be located on these sectors. Also, the cause of the bootloader breakdown may be installing a junior OS over Windows 10... To help our readers restore the bootloader, below we have prepared examples in which we will describe in detail how to restore it.

The easiest way to recover

Seeing a message about a malfunctioning bootloader, the first thing a PC user has to ask is how to restore the Windows 10 bootloader. In this example, we will describe the easiest way to restore it. For this example, we'll need.

If you do not have this disk and Internet access, you can create it on another computer with the same OS.

You can also use the original Windows 10 installation disc for this task. Well, let's get started. Insert the recovery disc into the drive and boot from it when the computer starts.

In the first window of the recovery drive wizard, you must specify keyboard layout, after which the wizard menu will open.

In this window we will select the second tab " Troubleshooting"And immediately go to the next" ".

In additional parameters, we are interested in the "" tab. After clicking on this link, the wizard will ask you to select an OS to restore its launch.

The test computer has one Windows 10 operating system, so there is only one choice in the wizard. After selecting the OS, the system will begin the procedure for finding computer faults and must restore the damaged bootloader.

If using this method you cannot restore Windows 10 to work, then in the following examples we will describe a detailed process for restoring the boot sector using system utilities DiskPart and BCDboot.

Repair Windows 10 bootloader using command line

For this method, we also need Windows 10 recovery disc... Let's boot from the disk, as in the previous example to the point "". In this menu, we are interested in the "" tab, on which we will go.

First of all, we will run the console utility on the command line DiskPart... To do this, enter the command diskpart in the console

We need this utility to displaying information about all local disks in the system... Now we need to find the bootloader partition number. This is usually a hidden partition with a size of 500 MB. This partition is created automatically by the Windows 10 installer. Next, to search for it in DiskPart, we will enter the list volume command

From the image you can see that the partition with the boot record is in the first volume on drive C. Also, in the image you can see that Windows 10 itself is installed on drive D. Now we must exit the disk program. This can be done with the exit command

After exiting DiskPart, enter the command bcdboot.exe D: \\ Windows Also note that the command uses drive D, since it is on it that a dozen is installed.

This command completely restored dozens of boot files. The principle of this command is to use the utility BCDboot... The developers specially created this utility to work with Windows boot files... It is also worth noting that thanks to the same utility, the Windows installer creates a hidden partition and copies boot files to it.

Repairing the Windows 10 bootloader using the command line (Method two)

In the second method, we will also use the utilities DiskPart and BCDboot and try to overwrite the bootloader. To do this, launch DiskPart and find out which disk contains our hidden partition and the partition on which Windows 10 is installed. Launching this utility is described above.

Now we need to format the hidden partition that is in the first volume. To do this, we will type the select volume 1 command which will select our hidden encrypted partition of 500 MB.

The next step will be to format the selected section. This is done in order to erase all files from it. For this operation, enter the command in the console format fs \u003d FAT32

After formatting our partition, exit the disk utility and enter the new command bcdboot.exe D: \\ Windows which we entered in the previous example.

This command will not fix the bootloader files as in the previous example, but will create new... As you already understood, this method is used if the first one did not work.

Another way to restore Windows 10 boot using command line

This method requires a utility Bootrec... Unlike the previous utility, this utility does not restore bootloader files, but restores boot record... That is, she rebuilds MBR - the first sector on the HDD. It is very important for the operating system that the MBR is safe and sound. When a computer starts up, its BIOS first of all looks for the MBR to start the operating system from. For this example, let's run the command line as in the previous examples. The utility in question has two main commands / FixMbr and / FixBoot The first command is required to fix MBRand the second creates a new... First of all, consider the situation when our MBR is damaged. To do this, enter the first command in the console.

In the image above, you can see that the operation was successful, which means that the MBR has been restored.

Now let's consider the situation when the first method does not work, that is, we will create a new MBR sector. For this we will use the second command.

From the image above, you can see that the new MBR sector was created successfully.

The examples show how easy it is to recover the MBR sector using the Bootrec console utility. If you have problem with startm Windows 10, we advise you to use this example first.

We clean the system from malicious software before restoring the bootloader

If a malicious program is the cause of the bootloader failure, then this the malicious code must be removed before recovery... In this situation, it will help you. This is the rescue disk that has many tools for restoring your computer, as well as treating it from viruses... You can download Dr.Web LiveDisk on its official website www.drweb.ru. This Live CD is linux based and free. This disc is distributed as an ISO image that can be burned both to an optical disc and to a USB stick. After the image is written to the disk, launch Dr.Web LiveDisk.

In the start menu, select the first item and continue loading Dr.Web LiveDisk. After a few seconds, the Linux-based OS should start, which is actually Dr.Web LiveDisk.

In this operating system, you can completely clean your computer from viruses and even make a backup of all information.

Also useful is the fact that this OS has full Internet support and a built-in browser. Firefox.

Summing up

In conclusion, I would like to say that if you know all the intricacies of bootloader recovery, then you can quickly fix your computer. It is also worth paying attention to the situation when it is impossible to restore the boot sector and the bootloader itself. In this case, you need to play it safe and use the full system recovery tools. Such means are complete system image, created by means of the Windows 10 operating system itself, as well as a program such as Acronis True Image... We hope that our material will help you restore the bootloader from MBR, and your computer will function as before.

Related Videos

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

Nuances and methods of Windows 10 system recovery through the command line

Restoring Windows 10 through 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 start OS rollback only through the console, you should use an installation disk or USB flash drive.

If you plan to roll back Windows 10 through the command line in the future, it is worth creating a backup system image. To do this, do the following:

  • We open the command line with administrator rights. Press "Win + R" and enter "cmd".
  • The console will open. Enter "mkdir c: \\ Imagen-Restaurar", where C is the letter of the drive where the Windows 10 image will be stored, 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 even freeze at 1%. However, you do not need to press buttons or turn off your PC. After copying is complete, go to the specified folder and check for the "wim" file. If it is, then the image was created correctly.

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

Method number 1. Using the bootrec.exe utility

  • We boot from the installation disk. We select "Diagnostics", "Additional parameters", "Command line".

  • In the console, enter bootrec.exe. An instruction appears describing the actions of each command.
  1. FixMbr - used in cases when the boot sector of the hard disk is damaged. By entering the command, the program will automatically fix errors and the user will be able to log into Windows 10 as usual;
  2. Bootcfg is a command to solve problems with the absence of a boot.ini file. To restore the functionality of Windows 10, you should enter "Bootcfg / rebuild";
  3. CD repair copy SYSTEM C: \\ windows \\ system32 \\ config - command for fixing errors with a damaged config file. After entering it in the console, prompts will appear on the monitor screen. For everything you need to answer "Yes", that is, enter the letter "Y".
  • Copy D: \\ i386 \\ ntldr С: \\ is the command for correcting the error "NTLDR is missing", where D is the letter of the drive where 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 previously created a system restore checkpoint or you have a Windows 10 backup image from which the system can retrieve missing files, you should follow these steps:

  • Restart your Windows 10 PC in Safe Mode with Command Prompt support.
  • Launch the console and enter "rstrui.exe".
  • Standard System Restore will start.

If it is impossible to rollback Windows 10 through the command line, it is worth checking the integrity of the bootloader.