Loading windows using the command line. System data recovery through "File history". How to write a new boot sector

The command line is a standard operating system tool that is used to enter commands. The specificity of the console allows you to run the recovery tool from both user interfaceand with 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 command line.

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

To create a folder for windows storage 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 the hard disk, but also on external device... It is enough to lead letter designation 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 procedure for creating backup Windows 10, 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 appears in the console stating about successful establishment and registering a recovery image.

Several nuances when working with the command line in Windows:

  • Do not use a space to separate words, do it with a dash (-);
  • While the copy is being written, the process may for a long time hang at a value of 1%. This is normal;
  • Once the copying process is over, go to the specified path and check the folder for the CustomRefresh.wim file. If not, then copying was unsuccessful.

Restoring Windows 10 using the command line

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

Before starting the 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 section additional settings choose to run the command line:

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 boot sector system HDD damaged by malware software... 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 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.

Some users in their lives are faced with the need to restore the Windows system. In this article, we will look at what a system restore is, how to do it, and all the additional points of this issue.


Content:

What is it for? System Restore can help if your computer stops working properly. This condition is caused by the installation of virus software that makes changes to the PC registry or the inept / harmful actions of the user himself.

When might a system restore be required?

  • The computer is hopelessly buggy, slows down, does not boot.
  • After installing a program, windows began to pop up, reporting errors at the RAM level.
  • Computer boot comes to window windows greetingsand then the computer restarts.

Windows System Restore - This is the restoration of the state of the OS, files and programs on the computer until the moment when the malfunction began. Sometimes the user misunderstands the meaning of System Restore and means returning to a previous version of Windows. For example, from windows 8 to windows 7. In fact, when the system is restored, its version does not change.

There are many ways to "breathe life" into your operating system, but we will cover 2 of the simplest Windows rollbacks:

  • System recovery using BIOS,
  • Recovery using the command line.


It is worth noting initially, windows 7 system recovery can be performed only if the recovery function (service) was launched earlier, before the problems appeared. If it was not enabled, then you can only rollback using the boot windows disk.
To activate the service restore windows you need to go to the "Control Panel", this can be done from the "Start" menu. Next, we are looking for an icon with the name "System Restore". Next, click on the tab with the name "Start recovery", the system will give us a message - the recovery service is disabled and will offer to activate it.

Typically, the first time you start Windows, a restore point is saved, even if the restore function has been disabled. To see the list of your restore points, you need to click the "View other restore points" button.

If this function has already been launched before, then we can immediately start starting the system recovery procedure. Click "start system recovery", select a restore point, click "next" and "done". The recovery process is launched, as soon as it is over, the computer will restart, after which you can start working.
What to do if System Restore doesn't work?

The most common problem is the not enabled recovery service. How to activate it is written above.

Of course, one cannot exclude the possibility of its complete inoperability. Very often this can be found if a non-licensed version of windows is installed.

System restore without a restore point is possible?

Most likely you have already entered the System Restore Center, activated the restore service and found that there is no backup point - it means that you cannot choose to which state you cannot roll back the system. Don't worry, your system can still be recovered!

System restore without a restore point can be done using the command line. It is recommended to strictly follow the instructions so as not to break anything. We will look at how to roll back the system using the command line below.

By the way, it is not necessary to use a disk, you can do a system recovery from an image by first re-encoding it and writing it to a USB flash drive.


Windows recovery software

If your operating system isn't quite dead, i.e. it is still loading and working somehow. Or, for example, built in Windows tools system restore does not help - try using special programs for windows recovery, such as:
1. - a program that will help you both restore the OS (registry, boot areas, access rights), and scan your PC for viruses and errors in files.
2. this software mainly focused on backup, files, logical disks (partitions), but Acronis can also recover Windows and even Mac OS.

How to restore the system via BIOS?

A huge advantage this method - successful system recovery even in the most difficult cases, the main thing is that the computer or laptop is turned on.
Make sure you have the installation disc handy ( boot disk) with Windows and insert it into the drive. Now we need to enter BIOS. When starting the computer, press the F12 key, go to the Boot -\u003e BootDevicePriority menu - select the DVD drive in the first place if you are using a disk, if the USB flash drive is USB HDD.

Restart the PC again, now it should start windows installer... Often, when the PC boots, an inscription in English pops up, which requires you to press any key to start booting from the disk. If this is not done, the computer will continue to boot in normal mode after 10 seconds from your HDD, and not from a bootable USB flash drive / disk as we need.

So, we booted from the disk and now in the installation menu select the item "System Restore", click "Next". After that, you have to select a restore point, it is best to use the first successful launch, but the programs you need may not have been installed there yet. Those. you will lose programs (and data in them) that you installed after creating the restore point. Press "Next" again, now the system will be restored. When the process is over, click "Yes, done." We reboot the system after removing the disk / flash drive from the drive.

System restore via command line

This method is recommended if there is no system restore point. Again, we need a bootable Windows operating system disk. Exactly the one installed on the computer.
You can view the OS version by clicking right click on the "My Computer" icon and clicking on the "System" tab.
If you have a system restore point, then you just need to boot into the command line mode (for this you need to press the F8 key when loading the OS and select the "Boot to safe mode with command line support ”). Then enter the command "rstrui" and follow the instructions.


1. If the boot sector of your OS is damaged.
Enter “fixboot” on the command line, press “Enter”, then enter “fixmbr” and press “Enter”. Everything, the boot sector of your windows is restored, you can restart your computer normally.

2. If missing boot file boot.ini.
Enter "bootcfg / rebuild" on the command line, press "Enter". For all possible questions systems we answer by entering "Y" and pressing the "Enter" button.

3. If you have corrupted config in the system32 folder.
Insert the disc with your version operating system into the drive, enter in the command line "cd repair copy SYSTEM C: \\ windows \\ system32 \\ config", press "Enter", done!

4. If files “ntldr” or “ntdetect.com” are missing and the system displays messages like: “NTLDR is missing at Windows startup”.
Enter in the command line "copy J: \\ i386 \\ ntldr C: \\", press "Enter" (Where J is the letter of the important drive, and C is the letter of your system diskwhere your OS is installed).

If you do not want to restart your computer, you can restore the system through the command line from windows. We insert the disc into the DVD-ROM, while the computer must be booted. Now you need to start the command line. To do this, in the Start menu, click Run or press the Windows + R hotkey.
We enter the following value there: "sfc / scannow", click "Ok" After that, all broken system distributions will be copied from the boot disk automatically. System restore, rollback is pretty quick and hassle-free.

How is System Restore different for notebook brands: Asus, Acer, Lenovo, HP, Sony, Samsung, Toshiba, Bell, Dell, Vaio, etc.?

I want to note that there are no major differences here. Availability possible different versions BIOS, but there an intuitive interface and tab names are preserved. With this, there should be no problems.
The second point is the BIOS entry key, they differ for these manufacturers. But this is not a problem either, you can see what you need to click on the picture that appears when loading.

  • Acer - F2;
  • Dell - F2 or F1;
  • Toshiba - F1 or Esc;
  • Sony - F1, F2 or F3.


Sometimes after a system rollback, when you first start a laptop or computer, a message appears with this error - this means that the recovery has not been completed successfully and strongly recommends trying again with a different restore point.

Try to recover on a different, earlier recovery date. If after that such an error pops up, then the problem is much deeper. This means that the problem is with viruses in your system that have corrupted the information about system restore points.

A program that checks the strength of passwords of system users. This utility is used by network administrators to calculate users with ...

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

Run command line

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

With the list of available tools open, first fix the startup errors. If the problem with the damaged bootloader cannot be resolved, go back to the list of tools and select Command Prompt.

Bootrec utility

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


Restart your computer. The bootloader repair is done, the MBR is overwritten, so Windows should start without problems. If overwriting the MBR doesn't fix the startup problem, try the remaining two commands:


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

BCDboot utility

If you cannot fix the MBR error, try performing a boot loader repair using the BCDboot utility. This tool allows you to create or restore a boot environment located in the active partition of the hard drive. If, as a result of a system failure, the boot environment has been moved to another partition on the hard disk, then using BCDboot.exe you will return it to its place.

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

Restoring a hard drive or flash drive does not always require the use of special software; sometimes you can fix errors with the built-in windows utilitiescalled CHKDSK (check disk). This program will check the disk for errors and fix them if found. CHKDSK can be launched in several ways, but we will dwell on the command line option in detail.

Command line recovery

To execute rebuilding hard disk with 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 restart to perform the check. Correcting errors on a USB flash drive using the CHKDSK utility does not require a reboot.

Let's analyze the command syntax:

  • "Chkdsk" - starts the verification utility.
  • "E:" is the letter of the hard disk or flash drive partition that you want to check using CHKDSK.
  • "/ F" - error correction.
  • "/ R" - restore bad sectors.

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

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

Windows won't boot

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


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

On Windows 7, after the first screen of the installer 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". Select Run Command Prompt from the list of available tools.

At this point, many users make the mistake of typing chkdsk without considering the drive letter with installed Windows... The problem is that in the recovery environment, letters are assigned a little differently - "C" denotes a 100 (500) MB partition allocated for the needs of the system, and the volume with windows files becomes "D" and so on.

For 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 partition with Windows files.

Having recognized the letter of the section, write it in the command syntax: for example, chkdsk D: / f. The disk check starts. If you need to scan hDD to find bad sectors, then run chkdsk D: / f / r. When prompted for a failure to execute, type Y and press Enter.

The disk check and repair will start. If everything was done correctly, then after completing the procedure, the system will work correctly. Do not forget to remove the boot from the flash drive if you set it up in the BIOS, otherwise Windows will not start.

For many years, Microsoft has been improving the Windows operating system recovery system in both Windows 7 and Windows Vista she works practically in automatic mode... If you boot from installation disk Windows 7 and click "" ("Repair Computer"), Windows repair system will start and try to fix any errors it finds on its own. It is able to fix a large number of problems, however, it is quite possible that the bootloader is damaged, and the recovery system cannot cope with this problem. In this case, you can manually restore the bootloader using the Bootrec.exe utility.

application Bootrec.exe serves to correct errors related to damage to the bootloader and, as a result, the inability to start operating systems Windows 7 and Windows Vista.

Sequencing

The utility will display help on the available command line switches.

Description of startup keys for the Bootrec.exe utility

Bootrec.exe / FixMbr - Launched with the / FixMbr switch, the utility writes a Windows 7 and Windows Vista compatible Master Boot Record (MBR) to system partition... Use this option to resolve problems related to damaged main boot record, or if you want to remove a non-standard code from it. The existing partition table is not overwritten in this case

Bootrec.exe / FixBoot - Launched with the / FixBoot key, the utility writes a new boot sector compatible with Windows 7 and Windows Vista to the system partition. Use this option in the following cases:

  1. The boot sector of Windows Vista or Windows 7 has been replaced with a non-standard one.
  2. The boot sector is corrupted.
  3. Was established previous version Windows operating system after windows installations Vista or Windows 7. For example, if Windows XP was installed, NTLDR (Windows NT Loader, Windows NT loader) will be used, the boot loader code for NT 6 (Bootmgr) will be overwritten by the Windows XP setup program.

It should be noted that a similar effect can be achieved using the bootsect.exe utility, also found on the Windows 7 bootable media. To do this, run bootsect.exe with the following parameters:

bootsect / NT60 SYS - The boot sector of the system partition will be overwritten with BOOTMGR compatible code. You can learn more about using the bootsect.exe utility by running it with the / help parameter.

Bootrec.exe / ScanOs - Launched with the key / ScanOs, the utility scans all disks for the installed operating systems Windows Vista and Windows 7. In addition, when using it, a list of found systems that are not currently registered in the configuration data store is displayed windows boot (Boot Configuration Data (BCD) Store)

Bootrec.exe / RebuildBcd - Launched with this key, the utility scans all disks for installed operating systems Windows Vista or Windows 7. Found operating systems are displayed in a list from which they can be added to the Windows Boot Configuration Data Store. Use this option also if you want to completely rebuild the boot configuration data store. Before that, you need to delete the previous store. In this case, the set of commands can be as follows:

bcdedit / export C: \\ BCDcfg.bak
attrib -s -h -r c: \\ boot \\ bcd
del c: \\ boot \\ bcd
bootrec / RebuildBcd

In the above example, the current boot config store is exported to a file C: \\ BCDcfg.bak, the attributes "system", "hidden" and "read-only" are removed from it, after which it is deleted by the DEL command and rebuilt by the command bootrec / RebuildBcd.

Of course the utility Bootrec.exe very functional, however, it will not help if, for example, the file windows bootloader bootmgr is corrupted or physically missing. In this case, you can use another utility that is also included in the Windows 7 distribution media - bcdboot.exe.

Restoring the Boot Environment with BCDboot.exe

BCDboot.exe is a tool that is used to create or restore a boot environment located on the active system partition. The utility can also be used to transfer boot files from one hard drive or partition to another.

The command line in this case may look like this:

bcdboot.exe e: \\ windows

Replace e: \\ windows to the path appropriate for your system. This operation will repair the damaged Windows Boot Environment including Boot Data Configuration Store (BCD) files, including the file mentioned above bootmgr.

Bcdboot command line parameter syntax

The bcdboot.exe utility uses the following command line parameters:

BCDBOOT source]

a source - Indicates location windows directoryto use as the source when copying the boot environment files.

/ l - Optional parameter. Specifies the language of the boot environment. The default is US English.

/ s - Optional parameter. Specifies the drive letter of the system partition where the boot environment files will be installed. By default, the system partition is set by the BIOS firmware.

/ v - Optional parameter. Enables verbose logging of the utility operation.

/ m - Optional parameter. Combines the parameters of the newly created and existing storage boot record and writes them to the new boot record. If the operating system loader GUID is specified, merges the loader object with the system template to create a boot record.

Summary... The article covered the principles of working with utilities bootrec.exe and bcdboot.exethat are used to resolve problems related to the inability to start the Windows 7 operating system due to a damaged or missing bootloader