How to restore registry to default in Windows 10?

5

I made a mistake, changed the value of .exe in the registry editor and currently I can not open the editor again or any other .exe program (nothing) .. Can I back up registry through cmd, I tried with

Xcopy c:\windows\system32\config\RegBack c:\windows\system32\config

But it returns me "0 files copied", files are in RegBack, OS is Windows 10. Also tried with system restore from 5 different system restore points, but it throws error, any ideas ?

MorganFreeFarm

Posted 2019-04-01T13:15:01.357

Reputation: 173

Answers

4

I bet you can open the Registry Editor by opening a command prompt (as administrator) and running:

regedit

.exe in the classes root are for Explorer to know how to work with .exe files.

Command Prompt should therefore be unaffected.

LPChip

Posted 2019-04-01T13:15:01.357

Reputation: 42 190

No I can't open it from .cmd but I can access folders, so tried to copy files. Via bash It returns me bash: /c/WINDOWS/regedit: Permission denied. Probably I should change User's permission, somehow ? – MorganFreeFarm – 2019-04-01T13:28:44.330

And if I open BASH and type cmd then type regedit it shows me path to exe with error No such interface supported after that show on console Access denied – MorganFreeFarm – 2019-04-01T13:46:44.980

4Do not use Linux on sensitive Windows files! – harrymc – 2019-04-01T13:57:55.443

Can you use the REG command in a command prompt? It is basically regedit but in a CMD interface. You can also try renaming regedit.exe to regedit.com and see if you can start it from the commandline then. – LPChip – 2019-04-01T14:21:29.317

Also, you do need to run cmd as Administrator. – LPChip – 2019-04-01T14:22:30.367

Where did Bash come from?! – FreeSoftwareServers – 2019-04-02T02:27:23.380

1@FreeSoftwareServers: My psychic powers tell me OP is using Windows Subsystem for Linux (WSL). – Kevin – 2019-04-02T03:49:24.477

2

Here is what I did:

  1. Enable Administrator account, base on this article:

    1. Activate the Start menu on the system.
    2. Type lusrmgr.msc and select the result that is returned to you.
    3. Left-click on "Users" in the left sidebar. You get a list of all accounts of the local system on the right.
    4. Right-click on Administrator and select Properties from the context menu.
    5. Remove the checkmark from "Account is disabled" on the Administrator Properties window and click apply, then ok.
  2. Open the Administrator account from Start -> Change user

  3. Open Git Bash here from some folder with right click, then open cmd from BASH and type regedit.
  4. Back values from HKEY_CLASSES_ROOT -> exefile and exefile -> shell -> open -> command to default (which I changed early).

P.S: I found a good way to change the values of registry if you are already closed Registry editor, this is example for exefile:

  1. Double-click a text (.txt) file in your system. (This opens Notepad.)
  2. From the File menu, click New.
  3. Copy the following contents and paste into Notepad.

    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\.exe] @="exefile"
    
  4. Save the file with .REG extension.

  5. Double-click the file to run it.
  6. This fixes the .exe file type ProgID.

MorganFreeFarm

Posted 2019-04-01T13:15:01.357

Reputation: 173

@LPChip Thanks for your help you guided me to open cmd from Administrator user : ) – MorganFreeFarm – 2019-04-01T15:02:34.917

You're welcome. If you really want to be awesome, hit the checkmark near my answer, given that that is basically what got you to the solution eventually. :) – LPChip – 2019-04-01T20:53:52.277

0

The best solution might be to go back to a previous system restore point.

See the article (among many) How to recover using System Restore on Windows 10.

One small problem : This is handled by a the process SystemPropertiesProtection.exe, which is an .exe file! Ouch!

You will therefore need to do this from a boot USB, as follows:

  • On a working PC, go to the Microsoft software download website
  • Download the Windows 10 media creation tool and then run it
  • Select Create installation media for another PC
  • Choose a language, edition, and architecture (64-bit or 32-bit)
  • Follow the steps to create installation media, and then select Finish
  • Connect the installation media you created to your nonfunctional PC, and then turn it on.
  • On the initial setup screen, enter your language and other preferences, and then select Next. If you don't see the setup screen, your PC might not be set up in the BIOS to boot from the drive.
  • Select Repair your computer
  • On the Choose an option screen, select Troubleshoot
  • Select Advanced options > System Restore.

You might also be able to boot into the Command Prompt, with a good chance that the copy will work in that environment. Only that this might take you back too far in time.

harrymc

Posted 2019-04-01T13:15:01.357

Reputation: 306 093

1Read the question, man : )) I already tried with system restore, there is 5 different system restore points, but cannot restore, has a file who cannot be restored – MorganFreeFarm – 2019-04-01T14:03:57.910

0

registry associations are not recursive.

1) Turn on "show file extensions

2) Create a new text file on the deskotp

3) type 3 letters cmd into it and save

4) rename to .bat

5) right click -> run as administrator

6) regedit

7) Undo your change

Joshua

Posted 2019-04-01T13:15:01.357

Reputation: 619

The OP seems to be able to run cmd; why do you believe that this is helpful? – G-Man Says 'Reinstate Monica' – 2019-04-01T23:12:47.630

@G-Man: There's a couple other ways to get a cmd open that bypass file associations, but none that get an administrative cmd open that I know of without creating some files. My understanding of borking .exe association is admin elevate of executables is completely broken, but this invokes elevation on a .bat. – Joshua – 2019-04-01T23:16:54.787