Restoring Windows 10 startup via the command line. Recovery methods without logging in. Using a USB drive

Like her predecessors, she “flies” at the most inopportune moment, everyone knows. In theory, the built-in automated means of rolling back the system to the last working state should work. But the problem is that it doesn't always work. And in order not to reinstall the system, you have to use system recovery via the command line (Windows 10 is used or another version, it doesn’t matter). The following will provide a step-by-step description of the entire process using several basic methods.

Problems with automatic and manual Windows recovery

So, first, let's look at why the automatic rollback tool doesn't work during critical failures (we're not talking about starting a recovery from a running system right now).

The main problem with trying to automatically rollback Windows to a previous state that was recorded at one of the checkpoints is that damage to the system boot loader at such points is not recorded. That is why the same Windows 10, upon completion of the process, displays a message that the rollback could not be performed and requires an immediate reboot, which, in general, has no effect and leads to the same result.

The same applies to the installation of the latest updates, which Microsoft turned out to be so unfinished that they “killed” many computers around the world, and some began to experience spontaneous reboots. Thus, restoring the Windows 10 system via the command line is almost the latest and only solution that will allow the system to be revived. Many users know about the actions used only by hearsay, and some are even afraid to use the command console. The following instructions will help fill this gap.

Restoring the Windows system via the command line: what is needed for this?

But let's see what tools you need to rollback. Since Windows does not boot in stationary mode, to access the command console you need to start it somehow. But how?

For this, removable media with recovery or installation distributions recorded on them (optical discs, flash drives, etc.) are used. Thus, you need to have such media in stock. If it is not there, you can create a bootable flash drive or disk quite simply on another computer terminal, using the “Recovery Center” section in the standard “Control Panel” or a third-party software package.

Preliminary actions

Now, to restore a Windows system - 7 or another modification - through the command line, you need to log into the command console.

To do this, in the BIOS settings, the removable device is set first in the boot priority, and after the boot menu appears, in order to avoid searching for a long time to start the command line, use the key combination Shift + F10.

Now the first thing you need to do is look at which partition is the system one. The fact is that when starting from a removable media, drive and partition letters may not be displayed, but numbers are used instead. At the command prompt, enter diskpart and list volume in sequence. After executing the second line, you should remember the system partition, and to exit, enter the exit command.

How to run System Restore via the command line?

Now you can begin the rollback procedure. As a rule, only one operating system is installed on user terminals, so to activate the process it is enough to enter the command bcdboot c:\windows.

If two systems are installed on your computer on different partitions, you can run the command twice, but do not forget to specify the volume in which each system is installed.

Note: This command does not work on Windows XP and may not work on some builds of Windows 7.

Alternative recovery method

Windows 10 can be installed via the command line in another, no less effective way, which, however, will take more time, but almost always works.

Enter the system partition definition commands again and find the hidden FAT32 partition in the list (for primary UEFI systems and GPT partitions its volume will be up to 300 MB, for MBR in combination with BIOS - about 500 MB). As before, remember the letter or section number.

Now, to start system recovery via the command line, you need to enter the following commands in a strictly defined sequence (we assume that our partition is marked with the letter N):

  • select volume N (select a section);
  • format fs=ntfs (format the partition into the desired file system);
  • assign letter=Z (set a new letter for the hidden section - you can specify it if desired);
  • exit;
  • bcdboot C:\Windows /s Z: /f ALL (set to boot from the system partition, taking into account the hidden one);
  • diskpart;
  • list volume;
  • select volume N (select the previously renamed section);
  • remove letter=Z (remove the volume so that it is not displayed in the system after the restart);
  • exit (exit the console).

After this, you can remove the removable device and perform a full reboot. In theory, the restart should go without problems.

Bootloader recovery: checking system files

However, this approach may not work if records and sectors are damaged. Restoring Windows 10 via the command line in such a situation will have to start a little differently.

In this case, the process involves checking system files and restoring boot records, and if impossible, completely overwriting them.

At the command line, after booting from removable media, as described above, enter the sfc /scannow command.

Actions with boot records and sectors

After it is fully completed, you should check the system starts in normal mode. If the result is zero, you should use the bootrec.exe tool, for which the fixmbr and fixboot commands are first entered, separated by a space and a right slash.

Again, after completing them, you should check the boot in normal mode. If the result is zero, the line rebuildbcd is written for this tool. As a rule, after entering such a line, loading of the operating system resumes. By the way, this is a universal method, and command line recovery of an XP system can also be done using this toolkit.

Recovery via DISM module

Finally, there is another verification and rollback method that uses image recovery. In this case we are talking about the DISM tool (CheckHealth or RestoreHealth).

It can be used in two ways: you can simply run a scan, followed by a rollback, or you can specify a restore immediately. In the same way, you can use two commands in succession if, for example, the first did not give any results. However, it is worth considering that this process of checking and restoring system files should only be used if the SFC tool did not work. If the process stops at about 20%, you can simply reboot the system and use SFC again, which will allow you to replace damaged system files with new ones. In general, this toolkit is considered to be the most last resort when nothing helps at all, although if Windows is very damaged, it may not give the desired effect.

A few final words

The only question that remains unresolved is which method to use to restore the Windows 10 system via the command line. In principle, there is not much difference between them, but you should run a scan or restore system files only if it is impossible to use the first two described options. But it also happens that when critical changes occur, it is impossible to roll back. In such a situation, there is nothing left but a complete reinstallation of the OS.

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

Get the Start button back in Windows 10

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

Recover Windows 10 with 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 failures in the OS.

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

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

Or use the Win keyboard shortcut
+Pause. The “System” window will open, where in the lower left corner there is a “security and maintenance” link.

Control Panel -> System and Security -> System, or Win+Pause

Expand the “Maintenance” tab and click on “Start Maintenance”

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

Restoring Windows 10 from the command line

The next way to restore system functionality is to restoring Windows 10 from the command line by checking the integrity of system files. Restoring missing or damaged system files using System File Checker is done by calling the command sfc /scannow


In the search, type "command prompt" or cmd, right click command line and click on the “Run as administrator” line. The search field in Windows 10 can be called up 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 recovery operation.

If restoring Windows 10 from the command line did not help

Error: Resource Protection has detected corrupted files but is unable to repair some of them

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

To restore the component store, you will need DISM - Windows Image Servicing System. In the Command Prompt window, enter:
Dism /Online /Cleanup-Image /ScanHealth


A message should appear: “The component store is subject to recovery.” Now you can begin repairing the storage facility. Enter the command:
DISM /Online /Cleanup-Image /RestoreHealth

When you execute the above command, the component store will be restored using the DISM tool, which uses − Windows Update. Naturally, the Update Center service must be enabled. If everything went without errors, you will see the message: “Recovery completed successfully. The damage to the component storage has been repaired."

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 has been repaired, to restore Windows 10 itself, you must re-enter the command sfc /scannow.

Repairing Windows 10 boot when it won't start

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

When this window appears, press Shift+F10

Command line window called by the magic combination Shift+F10

Due to certain system features, drive letters in the recovery console may differ from the usual assignment in Windows Explorer. To find out which 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 notepad menu, select “File” -> “Open”. Explorer will appear with a list of drives with letters assigned to them. By opening each one in turn, you can view their contents and find the system one. You can do the same use cd and dir commands to navigate drives from the command line.

Once you know the drive letter of the Windows\ folder (let’s say it’s the letter D), enter the following into the command line window:
sfc /scannow /offbootdir=D:\ /offwindir=D:\Windows

offbootdir=D:\ partition containing the WinSxS folder containing the original Windows component store

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

Hello blog visitors.

Sometimes users of computers with Microsoft operating systems encounter a situation where their device refuses to boot. At the same time, all sorts of errors appear on the monitor: “ OS wasn't found», « Insert boot disk" and others. This usually happens after installing a second OS on the device, changing hidden hard drive partitions, experimenting with EasyBCD. Most likely, this option will require restoring the Windows 10 bootloader. Later in the article I will tell you how this is done in various ways.

It’s worth saying right away that, in general, restoration actions for various modifications will be the same. Even regardless of whether a GPT or MBR disk is used, BIOS is installed or the modern version is UEFI.

It should be noted that the above errors do not always appear as a result of problems with the system bootloader. Sometimes the cause may well be a CD forgotten in the DVD drive, a connected USB flash drive, or an additional hard drive.

Automatic recovery( )

The developers of Windows 10 have provided a convenient function in their OS “ resuscitation" while loading. It is worth noting that this section works well. In most cases, this is enough to return the device to working condition. If, after installing Windows XP, you decide to upgrade to the latest version of the operating system and are experiencing problems at startup, you need to perform several steps:

Afterwards the process can go in several ways. So, a message about the impossibility of recovery will appear before your eyes. Or we will see the desktop (of course, first in the BIOS you need to return the launch from the hard drive).

But sometimes this method does not solve the existing problem. In this case, we’ll try to carry out the procedure manually using the utilities built into Win. This usually works better.

In manual mode( )

For the procedure, we again need bootable portable memory - without the distribution kit we will not be able to accomplish our plans. If this is not the case, use another computer to create it. It is important that the system is of the same build and capacity.

If you are using a boot disk, select “ Diagnostics", Further " Add. options"and the necessary tool.

In any case, a black window will appear in which you need to specify three lines, and after each click “ Enter»:
diskpart
list volume
exit

After the second command, a list of all mounted volumes will appear. We remember the letter of the one on which the system files are located. The fact is that during recovery it may not be a partition at all WITH:\, but any other. So it is important to define it accurately.

Most often, only one operating system is used on a computer. There is only one section MBR or EFI. So to restore the bootloader after installing Windows 7 and then using the tenth version, just run the following command:

bcdboot c:\windows

Important! Instead of “c:\” you will most likely have to specify another letter.

Interesting to know! If the computer uses two operating systems at once, the above command is executed twice. The main thing is to indicate the path correctly. However, this move will not work for XP and Linux.

After this, a message will appear that all the necessary files have been created. Next, remove the flash drive or disk and restart the device. Let's try to boot in normal mode.

Important! In some cases, the normal launch of the operating system does not occur immediately. You must first check the hard drive. And only with the next reboot everything will return to its place. So, as you can see, without the command line you won’t be able to accomplish your plans.

Another manual method( )

If the methods described above did not help, return to the command line. It's worth noting that if you do this from safe mode, then the bootloader has nothing to do with it. You can simply restore as usual.

So, in the appropriate program we write:
diskpart
list volume

After that, we need to study the information received. If you are using a system with , the list should contain a hidden FAT32 partition, the size of which does not exceed 300 MB. In the case when on a computer MBR and BIOS, look for the section NTFS 500 MB or slightly less.

In any case, users need to write down the partition number N and remember the letter where the system files are located.

Next, enter a number of commands and after each one, confirm your intentions by pressing “ Enter»:
select volume N
format fs=fat32(or ntfs - it all depends on the file system used)
assign letter=Q(this section is assigned a new letter " Q»)
bcdboot c:\Windows /s Q: /f all(assuming system data is on disk C:\)

After that, we close the environment and boot not from a portable device, but from a hard drive.

Recovery from third-party OS( )

In some cases, after Linux is installed on a computer as a second system, Win 10 stops starting. This is usually due to the corresponding sector being overwritten.

To restore the area we need after Linux, we do the following:

    We insert a boot disk or flash drive (as you can see, we can’t do without this).

    Select " System Restore" And " Diagnostics».

    We are interested in " Extra options", and then " Command line».

    A new window will open in which we indicate only two lines and after each click “ Enter»:

    bootrec.exe /FixMbr

    bootrec.exe /FixBoot

As a result, the functionality of the Microsoft operating system will be restored.

It's worth noting that this same method can be used when you need to locate a new bootloader in place of GRUB.

As always, you can watch a helpful video regarding this topic. It is described in detail here, and most importantly, it is shown how and what needs to be done.

I hope the above information will help you resolve issues on your device. Subscribe and tell your friends so you always know how to fix errors on your computer!

Operating systems can sometimes fail and Windows 10 is no exception. The new OS, like previous builds, may not load for a number of reasons.

  • Software failure due to incorrect installation of drivers and utilities.
  • Or a malicious attack when the boot sector on the system is damaged.

Often, when problems arise with loading the operating system, users make a decision. Although you can solve the problem with loading Windows 10 without reinstalling the OS, but simply restore the boot record.

Recovering Win 10 boot sector via command line

Before restoring Windows 10 via the command line, you need to prepare bootable media: or.

  • We insert our bootable media and reboot the computer. You must boot from this media.

In each individual case, when booting from installation media, the method may differ. But in most cases, computers use the key Esc to download Boot Menu and here select the media.

  • When the Windows 10 installation window appears, on the first screen we need to click the button Further».

  • Then select " System Restore».

  • The recovery menu will open, where you need to select “ Diagnostics" or " Troubleshooting».

  • Further, in the section “ Extra options", we are interested in the item " Command line».

But first, you can try the built-in boot tool. This utility, in automatic mode, can restore Windows boot. Everything is quite simple here, we select our operating system (if, for example, there are several of them installed on the computer). Often, this recovery method works successfully, and Windows boots in normal mode after recovery.

  • But in some cases, only manual bootloader recovery using the command line will help. We launch the command line, it opens in the usual window we are familiar with. And here you need to enter the command bcdboot.exe (in small Latin letters), then a space. Next, you need to specify the system drive letter, in our case it is ( D) - this is what the command will look like:

bcdboot.exe (drive letter) :\Windows

How to find out the drive letter

  • To find out which letter we need, before starting recovery, type the command:

diskpart - click Enter

  • Next, when the tool starts DISKPART, you need to enter the command:

list disk

  • Information about the available disks will open; based on the size, we can determine which one we need. Next, you need to open detailed information about the system disk with the command:

sel disk 0

  • When a message appears that disk 0 has been selected, enter the command:

detail disk

  • In the information that opens, you can already see what name is assigned to our system disk.

Why are all these manipulations needed? The fact is that in the system our local disk may by default have the letter ( WITH), and on the command line, it can be a completely different letter (In our example, this is the letter D). We found out which letter is assigned to the system drive and now to exit the service DISKPART recruiting a team - Exit and click Enter
We return to recovery and write the command - bcdboot.exeD:\Windows, then click Enter

After you see a message that the download files were successfully restored, you can close the command prompt and restart your computer. In fact, everything is much simpler than it seems at first glance. , this is a last resort solution, you can always try to correct the situation using the Windows tools built into the system.
@

Hi all! People, in this publication we will continue to talk about Windows 10 recovery via the command line. I know that many users don’t really like to tinker with manually entering various combinations, but practice shows that these methods are the most effective.

Again, perhaps someone will think, why bother so much if you can simply reinstall the damaged operating system and everything will be fine. I agree, but what should you do if problems arise on your work computer?

After all, such machines often have various departmental programs installed, the cost of which sometimes exceeds the price tag of the PC itself. Here you can’t help but wonder what’s special when the system generally refuses to start.

So, comrades, let's move on to a detailed description of another very effective method of restoring system files, which can help even in cases of 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 read some previous materials on this topic, since this will make it much easier to understand the essence. Here they are:

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

Then, at the stage of selecting a language, press the key combination “Shift+F10” on the keyboard to open the command line:

And open a regular notepad in it:

Notepad

Why do we need this? 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 a running installation environment, its letter may be shifted, that is, it may not be « C « , as is customary in normal operation. Therefore, we follow the “File-Open” path:

Then indicate “All files” and go to the “This computer” tab. In the window that opens, you need to view the contents of the logical partitions of your computer’s hard drive and find the system partition in the corresponding folders. In our case it is « D « :

How did I understand this? Here are its contents:

After that, close Notepad and enter a combination on the command line that will start checking and restoring the integrity of system files. This :

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

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

And “offwindir =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. The scanning process will now begin, which will take some time.

And if the backup storage is not damaged, this operation will be successful. But if you receive errors like “Windows Resource Protection cannot perform the requested operation,” it means that the component store itself is also broken, which makes it impossible to restore using it.

But don’t despair, we have a backup plan for this case. After all, what’s stopping us from specifying the path to the backup files that are on the bootable flash drive or installation disk? Do you get the point?

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

Then we enter the following command by hand:

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

Where “D” is the partition with the installed system (inoperative). “F”, the letter under which is a bootable USB flash drive or disk with a Windows image. "E", partition with the 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 now does not understand what we are talking about, return to the beginning of this article and re-read the previous publications, links to which are given as recommended ones. Well, it seems we have a victory this time:

From the screenshot above, we can conclude that restoring Windows 10 via the command line using a USB drive or disk was successful. All that remains is to launch SFC. And here it is worth repeating that the method described in the article is recommended for use 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, we will discuss your problems and look for solutions. And in conclusion, as always, I suggest watching another interesting video.