Inability to start Windows due to damaged registry files. Restore the registry through the command line

Ideally, when you turn on a Windows-based computer based on a family of kernels that have been leading their way back to NT, the system boots up normally. If the download is completed successfully, the standard Windows shell - Explorer (in the manager

But sometimes, as a result of some phenomena, the boot process can be disrupted, which will damage the operating system and make it impossible to work. The most common causes of the problem are power failure and malware, third-party actions. Restoring the registry to normal is exactly what can quickly help in this case.

There are different "levels" of damage to a system. If the splash stage has been passed and the Explorer shell color scheme is displayed (Desktop), and then loading does not occur, then you can limit yourself to the rollback procedure to the previous state of the system. To do this, when loading, press the F8 key on the top of the keyboard, which initiates a menu in which you need to select the item In the All Programs menu, select Standard, then Utilities, item (rstrui.exe). Choose any point before the date of the unfortunate failure and reboot. If you are lucky and the reason is really in the registry, which happens quite often, the system boots as a result of these actions.

There are also fatal crashes when the download does not occur at all. Typical symptoms are a blue screen during the boot phase or indicating that the system cannot load part of the registry. No problem. A couple of magic passes - and the system works again! But here, like any business, it also has its own subtleties. After all, the cause of fatal failures can be not only software collisions, but also hardware problems (damaged RAM modules or the basis of the system - the motherboard). Before attempting to fix the system, they should be checked. To do this, open the case and make sure that the capacitors on the motherboard are in order. Then try to boot with one or another RAM module. If there is only one module, then replace it with a new one; if it is not possible to do this, test the operability of the RAM with the memtest86 utility (you can find it on the wonderful collection for PC resuscitation procedures - Hiren's Boot CD).

None of this helped? Then the problem is really in the registry. We are trying an elementary trick with loading the last healthy state, which includes restoring the registry, or rather, a small part of it (one of the items in the menu by F8). Did not help? Then we proceed to the "reinforced concrete" option - we do the restoration of the registry. To gain access to the file system, use. Take the disk with the Windows distribution, wait for all drivers to load and press the R key. Exit to the recovery console. Then we replace the damaged "registry hive" with the copy command, specifying the path to C: \\ WINDOWS \\ REPAIR \\ REGISTRY_NAME, and the destination path will be C: \\ WINDOWS \\ SYSTEM32 \\ CONFIG

This is enough to boot the system in its original form. In the simplest case, work on this will be completed if SYSTEM is damaged - it will only be necessary to manually re-show the system the path to the device drivers. Most often, this can serve as just a temporary measure only until that happy moment, until you gain the right to read the System Volume Information directory, where a system snapshot is stored that allows you to restore the registry (restore points).

To gain access, go to the "Control Panel", there we look for the "Folder Options" icon. We remove the checkboxes "hide protected system files", and do not forget about the checkbox "use simple shared access to the folder". We go to the C: drive and look at the coveted "System Volume Information". In the properties of the folder, go to the tab under the name "security" and do the operation of adding the current user to the list. Accessed.

We go to System Volume Information and to the entire subdirectory tree. We are looking for an RP (Recovery Point, recovery point) of the most recent date, go to the Snapshot subdirectory. Copy the _REGISTRY_MACHINE_SOFTWARE registry hive we need to C: \\ WINDOWS \\ REPAIR. Load the recovery console and use the "copy" command to copy the registry hive from C: \\ WINDOWS \\ REPAIR to C: \\ WINDOWS \\ SYSTEM32] CONFIG. A few seconds after the restart, everything works again! The registry has been restored. A feature of the WiNDOWS Vista and Seven versions is the location of the backup registry files in the C: \\ WINDOWS \\ SYSTEM32 \\ CONFIG \\ REGBACK directory, which simplifies the above algorithm to one action (moving the registry hive file from the Regback folder to the vital for the operating system directory C: \\ Windows \\ System32 \\ Config Thus, restoring the Windows 7 registry is easy.

The registry is a large database that stores all the parameters necessary for the normal operation of the operating system. You can view it through the registry editor, which is available in Windows. Any user can enter it if his account has administrator rights.

And if you made any changes, or, for various reasons, or you accidentally pressed the wrong key and deleted a parameter or a whole registry branch, then this may not have the best effect on the computer.

And yet, if this happened, let's figure out what are the ways for repair Windows 7 and Windows 8 registryfor normal computer operation.

Restore the registry using a backup

As you probably guessed, this method is not for everyone. If you previously created backup copies of the registry through "File" - "Export" - read on, if not - go to the next method.

So, you have a backup copy. Press the combination Win + R, the "Run" window will open. In the "Open" field, write regedit and click "OK".


The Registry Editor window should appear. In it, go to the "File" tab and select "Import" from the menu.

File Explorer will open, find the previously created backup and click "Open".


Wait for the files to be copied.

Restore the registry using system restore

System recovery can be done using. You could create them earlier, when the system worked stably and everything suited you. Or they could be created automatically by the system: when making changes to the configuration of the computer, before installing drivers, etc.

Consider first, how to restore the registry if the operating system boots... In Windows 7 go to "Start" - "Control Panel".


Here we are interested in the item "Recovery".

In the next window, click "Start System Restore".



Now you need to select a restore point. If there are several points, and you are in doubt, look at the date the point was created - did your computer work normally on these numbers ?! - choose her. By clicking Search for Affected Programs, you can see which programs will be removed as a result of recovery. Click "Next".


We confirm the rollback of the system to the selected state by clicking "Finish".


All data, including the registry, will correspond to the state that was at the time of the creation of the selected restore point.

If you have Windows 8 installed on your computer, read the article:. There you will be interested in the second part. The actions will need to be performed the same as described above.

Repair the registry if the computer does not turn on you can too. In the Windows 7 operating system, when the computer boots up, press the F8 button at intervals of 1 second. A window will appear "Additional download options"... In it, use the arrows to select the item "Troubleshooting computer problems".


In the next window, select your language and click Next.


Select your account, it is better to have administrator rights, then enter the password, if you have it set when you log in, and click "OK".


The following window should appear, select the item "System Restore".


The recovery window will open, click "Next" in it and repeat the steps described in the paragraph above.


If you have Windows 8 installed on your computer, you can press F8 or Shift + F8 when booting, but the window for additional download options is unlikely to appear. It is best to use a system recovery disc or a bootable USB flash drive. You can create them on any other computer with Windows 8 installed.

Follow the link and read the article. Everything is described in detail there. The following window should appear. Then follow the path: "Diagnostics" - "System Restore", and select the desired restore point.


Restore the registry through the command line

In Windows, the files that are responsible for the operation of the registry are stored in the following path: C: (your system drive letter) / Windows / System32 / config. There is also the RegBack folder, which stores backup copies of all registry branches. They are automatically updated by the system, depending on the settings, every 5-10 days.


We need to do the following: delete the DEFAULT, SAM, SECURITY, SYSTEM, SOFTWARE files that are in the config folder and replace them with similar files from the RegBack folder.

We will not be able to do this in the operating system, since it will be necessary to replace the files responsible for its operation. Therefore, you need to use additional boot parameters and open a command prompt.

In Windows 7, press F8 at boot time. Then you need to do everything as described in the paragraph above. In the window System Recovery Options, select item "Command line"... As a result, the command line will be launched as administrator.


In Windows 8, you can open the command prompt using the combination. This is described in detail in the article:. Read the point: enter safe mode using the Shift + restart combination. When the following window appears, select "Command line".


If the computer does not turn on at all, due to changes in the registry, then read the paragraph: go to safe mode using a system recovery disk (you can create it on any computer with Windows 8 installed).

So, we launched the command line. Now we enter the following commands line by line. Press Enter at the end of each line. First, let's create a badreg folder on the system drive, and copy all the files of our non-working registry into it. Then we can safely delete the DEFAULT, SAM, SECURITY, SYSTEM, SOFTWARE files from the config folder, because we have copies of them. Finally, copy the backups from the regback folder to the config folder.

MD c: \\ badreg
copy c: \\ windows \\ system32 \\ config \\ default c: \\ badreg
copy c: \\ windows \\ system32 \\ config \\ sam c: \\ badreg
copy c: \\ windows \\ system32 \\ config \\ system c: \\ badreg
copy c: \\ windows \\ system32 \\ config \\ security c: \\ badreg
copy c: \\ windows \\ system32 \\ config \\ software c: \\ badreg

delete c: \\ windows \\ system32 \\ config \\ default
delete c: \\ windows \\ system32 \\ config \\ sam
delete c: \\ windows \\ system32 \\ config \\ system
delete c: \\ windows \\ system32 \\ config \\ security
delete c: \\ windows \\ system32 \\ config \\ software

copy c: \\ windows \\ system32 \\ config \\ regback \\ default c: \\ windows \\ system32 \\ config \\
copy c: \\ windows \\ system32 \\ config \\ regback \\ sam c: \\ windows \\ system32 \\ config \\
copy c: \\ windows \\ system32 \\ config \\ regback \\ system c: \\ windows \\ system32 \\ config \\
copy c: \\ windows \\ system32 \\ config \\ regback \\ security c: \\ windows \\ system32 \\ config \\
copy c: \\ windows \\ system32 \\ config \\ regback \\ software c: \\ windows \\ system32 \\ config \\
exit

After you enter the exit command, the command prompt window will close and the computer will restart.

I hope one of the ways will help you restore the registry in the Windows 7 or 8 operating system.

The registry is a database that contains all Windows OS parameters, user accounts, installed software settings, etc. If one or another branch of the registry is damaged due to inexperienced user actions, software failure or exposure to viruses, the system begins to function incorrectly or stops working altogether.

The following applications exist to return registry settings:

  • windows system recovery;
  • registry backups;
  • command line;
  • eRUNT program.

Using System Restore

This program allows you to restore the performance of Windows in many cases, including when the registry is damaged. It can be started in two ways:

  • directly through the OS;
  • using the Windows boot disk.

To apply the first method, it is necessary that 2 conditions are met:

  • the system was loaded, that is, you could enter it;
  • restore checkpoints have been activated.

Checkpoints are files that record data about the state (parameters) of the OS and all installed programs at a certain point in time. Restore points are created by default for the system partition. For other disks, they must be manually activated.

To restore the default Windows 7 registry settings using checkpoints, you need:

If the OS does not start, then to rollback you need a bootable disk with Windows 7 of the same configuration as on the computer. The sequence of actions will be as follows:



After completing this process, the registry will roll back to the default settings.

Applying backups

If System Restore is disabled by the user, then you will not be able to use the above example. In this situation, registry backups come to the rescue. They can be started in two ways:

  • through the Regback folder;
  • using the Regedit command.

In the first case, you need:



If you don't want to mount LiveUSB, you can use the Regedit procedure. However, in this case, a working copy of the registry must be saved on the PC. To create it, you need:



To restore the registry in case of a failure, you just need to run the saved file with the .reg extension. After that, all data will be rolled back to the previous state.

Restore the registry using the command line and the ERUND application

This method is suitable in cases where the OS does not start and there is no Windows installation disc at hand. ERUND is easy to use and requires a minimum of system resources.

To restore information using this program and the command line, you will need a registry backup, that is, a copy of it. The order of its creation will be as follows:



To restore the registry using the command line, you must:



Having restored the registry to work, you need to check your PC for viruses, since in most cases it is they that lead to system failures.