I've been wondering what would happen if I delete all the registry stuff. Would my PC stop working? Edit: I've edited the code, now it should delete the registry.

cd %TMP%
reg query HKCR> RegTest.txt
reg query HKCU>> RegTest.txt
reg query HKLM>> RegTest.txt
reg query HKU>> RegTest.txt
reg query HKCC>> RegTest.txt
@pause && cls
for /f "delims=" %%I in (RegTest.txt) do reg delete "%%I" /va /f
  • Well, nothing happened. Command completed successfully though. So nothing changed, lol :-) Edit: Ofc. i rebooted it.
    – Haplo
    Oct 25, 2014 at 19:33
  • open regedit post a screen grab... then reboot it .....
    – Logman
    Oct 25, 2014 at 19:34
  • Before Reboot It's in Turkish but it says command completed. And after reboot.
    – Haplo
    Oct 25, 2014 at 19:41
  • How mutch time did it take to delete it? and what changes after reboot? when u opened regedit after rebood was it still empty?
    – SkYWAGz
    Oct 25, 2014 at 19:44
  • Like i said nothing changed. Registry keys was not deleted and command completed immediately. So, like i said you can't do something like this.
    – Haplo
    Oct 25, 2014 at 19:47

2 Answers 2


You can’t delete the root nodes. They don’t physically exist. You can, however, delete their contents, via Regedit (as opposed to reg).

Regedit hangs as soon as I try to delete HKLM\SYSTEM. After resetting the VM (because I’m lazy), I get the following screen (OS is Windows XP):

enter image description here

(“Windows could not start because the following file is missing or corrupt: \WINXP\system32\config\SYSTEM”)

So yes, deleting stuff from the registry will absolutely positively kill Windows. And unless you have a backup, restoring it is impossible.

  • thanks for testing/demonstration and I don't think you could have been clearer with the outcome of deleting the registry "absolutely positively kill Windows"! Out of curiosity what VM software are you using?
    – benscabbia
    Oct 25, 2014 at 21:50
  • 6
    "impossible" as in theoretically or practically? Oct 26, 2014 at 9:25
  • 2
    @BleedingFingers Are you referring to undoing the damage? Because the registry is never the same for two Windows installation that are actually in use, you cannot use anything but a very recent backup to fully restore the PC. Granted, with less critical stuff like file associations, using another installation’s data might work.
    – Daniel B
    Oct 26, 2014 at 9:30
  • 2
    Without a backup, you'd need to try and use another machine's registry files, because the registry is used to locate drivers very early in the boot process (e.g. things like disk drivers), and without some very basic drivers, the kernel doesn't know how to interact with the hardware. Oct 26, 2014 at 19:00
  • 3
    Usually, Windows makes numerous backups of the registry automatically, most via restore points. In Windows XP, you could look at these registry snapshots in C:\System Volume Information and then copy them over to C:\Windows\config. I did this once with an old laptop successfully.
    – oldmud0
    Oct 26, 2014 at 21:47

Windows stores a lot of critical information in the registry, which is loaded (at least a part of it) during an early stage while booting. If you remove this information Windows will be unable to find and load critical system files and thus be unable to boot.

Such critical information is e.g. the list of device drivers needed for booting the system. This may include:

  • disk drivers (floppies, hard disks, CDs, USB-devices, ...)
  • bus drivers (IDE, SATA AHCI, ...)
  • file system drivers (FAT, NTFS, ...)
  • ...

However, by default Windows stores a backup copy of the registry. If you've enabled "System Restore" you can find such copies in the (hidden) System Volume Information Folder inside the root folder of the system partition. Additionally, even if you do not have "System Restore" enabled, Windows saves a backup copy of the registry in %WINDIR%\System32\config\RegBack\.

You can manually copy the backup files into %WINDIR%\System32\config\ to restore the registry data.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .