Many years ago when I was still a novice in computer, I accidentally disabled userinit.exe from startup thinking that it was a spyware using Autoruns. When I restart my computer, I was unable to login to Windows. Whenever I select the user from the list, it logs in and automatic logs off. I had a really tough time trying to restore userinit.exe back to Windows startup list as it wasn’t easy accessing and editing the registry when Windows is unbootable. Autoruns is much smarter now because when you uncheck userinit.exe from Logon, it will warn you that “disabling or deleting Userinit will prevent users from logging on”.
In the end I managed to fix the problem but I couldn’t exactly remember how I did it because I tried many many ways and I got lucky. Today I found a real solution on how to edit Windows registry key values without booting in Windows. If you have a similar situation as my previous case which requires you to edit the registry without Windows, then here is how to do it.
I currently know of 2 ways to do it. One is the easier way and the other way is a longer and more troublesome way. Both requires booting up the computer using CD.
I will first explain the tougher method on how to access registry without booting in to Windows using UBCD4Win. I’ve previously written a guide on how to create a UBCD4Win CD. Once you have the CD created, just follow the few simple steps below.
1. Boot up computer with UBCD4Win.
2. Once Ultimate Boot CD 4 Windows is fully loaded, click Start > Programs > Registry Tools > RegEdit

3. Select HKEY_USERS
4. Click File from menu bar and select Load Hive
5. Browse to C:\Windows\System32\Config\ and select SOFTWARE. Make sure that it is C:\ and not X:\ drive, otherwise you’ll be loading the CD’s registry.
6. Enter the Key Name as NEWHIVE.

7. Expand HKEY_USERS and you’ll see a newly created NEWHIVE in the list. Expand the NEWHIVE and locate the following location.
HKEY_USERS > NEWHIVE > Microsoft > Windows NT > CurrentVersion > Winlogon
8. Double-click Userinit and set it’s value correctly such as C:\Windows\System32\Userinit.exe,

Important Note: Make sure you include the comma at the end after Userinit.exe. It is there by default.
9. Go back to HKEY_USERS and select NEWHIVE.
10. Click File from menu bar and select Unload Hive. Click Yes when asked if you are sure you want to unload the current key and all of its subkeys.
If you already have UBCD4Win created, the whole process is much faster. However, I understand that not everyone has Windows XP disc on hand. So here’s another great free tool called PC Regedit which lets you create, delete and edit Windows registry key-values without Windows.
1. Download PC Regedit
2. Burn the downloaded PCRegedit.iso to a disc. Refer to this guide on how to burn ISO images on a CD.
3. Boot up the computer with the PC Regedit disc and it will load up ISOLINUX 3.11.
4. When everything is loaded, you will see a MyFileChoose Title window. By default you are at config folder. Scroll down a little, select SOFTWARE and click OK.

5. Navigate to root > Microsoft > Windows NT > CurrentVersion > Winlogon.
6. Look for Userinit key and make sure that the value is set as C:\Windows\System32\Userinit.exe, If the Userinit key is not there, you can add a new key by right clicking at the right pane and select Add Key.
You can use this method to load up other registry files and edit them. Here are the explanation of the 5 registry files for HKEY_LOCAL_MACHINE.
Registry Location: HKEY_LOCAL_MACHINE\SOFTWARE
File: SOFTWARE
Backup: SOFTWARE.LOG
Registry Location: HKEY_LOCAL_MACHINE\SECURITY
File: SECURITY
Backup: SECURITY.LOG
Registry Location: HKEY_LOCAL_MACHINE\SYSTEM
File: SYSTEM
Backup: SYSTEM.LOG
Registry Location: HKEY_LOCAL_MACHINE\SAM
File: SAM
Backup: SAM.LOG
Registry Location: HKEY_CURRENT_USER
File: NTUSER.DAT
Backup: ntuser.dat.LOG
Registry Location: HKEY_USERS\.DEFAULT
File: DEFAULT
Backup: DEFAULT.LOG
On Windows-NT based systems such as Windows NT, 2000, XP and Vista, each user’s settings are stored in their own files called NTUSER.DAT and USRCLASS.DAT inside their own Documents and Settings subfolder (or their own Users subfolder in Windows Vista). For example, C:\Documents and Settings\Raymond\NTUSER.DAT.
Related posts:
A thousand thanks for the tutorial, I have use PCREGEDIT several times and it is great. I am having a problem: I had a crash and have two corrupted reg entries in HKEY_USERS.DEFAULT. In PCRegedit I follow: System32configdefault. When I click OK it says it can’t read the data. However, when I use regedit in Windows 7 Ult. I can see it ok, but it gives me an error message when I try to delete it. Can someone tell me where I am going wrong? Thanks in advance!
On your motherboard BIOS try changing your SATA to IDE compatible mode and turn off native mode compatibility.
Ok I know I am a lame computer person and it might be some stupid mistake I’m making but I swear I followed every instruction to the the T several times and every time I try to use PC regedit it loads and says “Ok, booting the kernel” then comes to a different screen with errors that say:
!! Invalid loop location: /root.dat
!! Please export LOOP with a valid location, or reboot and pass a proper loop=…
!! kernel command line!
Any ideas what I am doing wrong? I know this is an old post but I have been at this for hours and I really need some help.
Thanks
Jac
This post just saved my life. OK, maybe not my life, but a hell of a lot of trouble. Thanks!
This post just saved my life. OK, maybe not my life, but a hell-of-a lot of trouble. Thanks!
A thousand thanks for that, it saved my tail today.
you are so good, uhm, I like you!!!!!!!!!!!!!!!uhmmmmmmmmmooohhhhhhuhmohhhhh
PC Regedit saved me big time! THanks Raymond!
hi
thank soooooooooooo much
it was great
i suddenly deleted “userinit” key patch in registry and i couldn’t do anything
i used hirens boot CD (mini windows xp) and edited my registry in the way u said
again thanks so much
Thank you and Thank you agian Rayomd for this detailed explanation on how to use PCregedit to restore userinit; I have regain control of my pc after 5 hours of pure panic! Thaks also to the PCregedit team, wherever they are.
This is an awesome page compared to dozens I have been through today.
All the best!
This really worked for me. I used Bart PE to access the registry edit. I have spent days over the last few weeks trying to solve this problem and this finally did it. It was due to a virus either w32silly – forever.exe or music.exe which came onto the computer via an infected USB memory stick. I was aware that the userinit.exe file was the problem but the other solutions suggested elsewhere never worked (perhaps it was the comma at the end?) Thanks very much.
Thanks a million Raymond, you’ve saved me a LOAD of work with this tutorial! Awesome work and highly appreciated. Highly!!
Hi,
I tried this solution. I had no userinit when I checked the registry out with PCRegedit. I added the userinit.exe file to the winlogin but is that it? I booted up and it still logged off. Am I supposed to add C:\windows etc next to the userinit.exe or does that map to there? Thanks
U are a genious!!! Thank u so much!!
Login Logoff Loop no more. What a great post, easy to follow Deliastyle walkthrough. Thank you.
I tried PCRegedit linux live CD, it uncompress and load fine, then it shut itself down and unload so I’m also in a live cd on-off loop now!
Many thanks Raymond – this link was a great find. I have never seen this problem before & I have been working in IT for many years. I tried numerous things but continued to scratch my head for two weeks before finding this article. It thankfully saved me from the time consuming PC rebuild, which I was beginning to think was my only option – well done for producing a great fix.
Hi Raymond,
I am also a victim of the login logoff loop victim on my xp home edition hp laptop. I did try your ISOLINUX option. My CD ROM is getting recognized at the time of boot. But it gets hung at one point with a message “Uncompressing Linux…..ok. booting the kernel. After this step nothing comes up and in few minutes my windows again goes back to boot mode. The MyFilechoose title window is not at all poping up. Any suggestions would be appreciated.
Many thanks to you and the author of PCRegedit, this saved me.
Nice to know have software like this, however is tere any way to do it with out having any third party softawres and use any built any commands in windows?
Thanks for posting this. I have been working on computers for 9 yrs. and this is the first time I saw the logon loop issue. My client and I thank you!
Thanks bro. Your tutorial has save my wifes laptop. I use PC Regedit and burn it into a cd. Then i follow your instruction. Thanks once again.
wow, that’s perfectly works! thank you so much!
Hello Raymond, I had a similar problem with you. The problem with my case is my useinit file was infected with a virus still can’t figure out yet. Realising my userinit.exe file was infected (through virus scan), i simply disable the userinit entry in Autorun.exe (by sysinternals) and wasn’t too care about what the dialog box was talking about. Simply clicked Ok, then the next time i restarted my PC, the infinite logon-logoff loop strike me.
Through my other PC i manage to Google this page. Man, what you’ve done is what we as PC not-so-expert user commend. Thanks bro! You really saved millions others who are careless enough to mess with their useinit.exe entries in the registry. Hehehe.. Cheers..
Wow, thanks you saved my wifes laptop.
Had to change the BIOS setup as well to read the cd drive first.
Thanks again!!!!!!!!!
I have same problem and trying to do the same but without anything u mentioned as i have a dual boot system and i can boot from other one that i used for general purpose for all user and quick load.
the main booter is having problem with msg that awgina.dll is missing from system32 on normal boot and the option this msg gives is only to restart. on restart of safe mode, it is auto logoff quickly as u discussed.
now using second boot i used some s/w that read the ntuser.dat file and open it in regedit, i verified that the path are there that u r told to add there. so dont sure what is the problem then. btw, i have not installed pcanywhere that the cause is given for awgina.dll to replace msgina.dll. i have both of these dll in system 32. i tried to rename the awgina.dll , from second boot, and try to boot again but the problem persist.
so not sure what is the problem that looks similar to this but the solution is not working. the final thing to update the registry that i done also.
any idea???
hey raymond.if i don’t know the logon password for windows can i still use this method?[like "CD-konboot-v1.1-2in1"] please tell me?
Man,
You really saved my bacon with this fix – many, many thanks. There were two things that I had to do a bit differently, though (I used the PC Regedit fix for my situation).
1) Even though I couldn’t logon, Windows did attempt to start so I went into the BIOS setup to disable the A: drive and HDD, forcing the CD drive to be seen.
2) After navigating to the offending key, I had to edit the key instead of adding a key.
Other than that, your fix worked perfectly and, again, many thanks.
Erich Frerking
Thank you, very good work. I followed the second option downloding PCRegEdit.iso
It worked just fine.
Thanks! You just saved my computer! I had a virus and was a bit too zealous in cleaning it out, messed with something in Hijackthis, and got caught in an endless logon/logoff loop. NOTHING worked, and I was ready to do system restore and just start over. Then I landed on this page and, seriously, a few minutes later my computer was back in working order. You rock!
Hello , Firstable , thank you for your help and guidelines,
today I need to communicate you that your links values without Windows.
1. Download PC Regedit
2. Burn the downloaded PCRegedit.iso to a disc. Refer to this guide on how to burn ISO images on a CD.
on this current site dont work, everytimes I click them I get <> ..
Thnk you so much, Goood day..
path to download pc regedit
@Raimond tnx for tutorial ;)
Hi, I’ve been trying to rid my machine of a trojan horse, and your tip sounds like it might work. But, after following your steps to use PC Regedit, couldn’t get the disk to boot in my Vista tablet. I received the following error:
!!Invalid loop location: /root.dat
!!Please export LOOP with a valid location, or reboot and pass a proper loop=…
!!kernal command line!
Any ideas on why this won’t work on my machine? Any tips would be much appreciated.
Dios te bendiga grandemente por tu aporte!!! me has salvado de una que no te imaginas…. mil gracias!!! Use el PC Regedit y me fue de maravilla!!!
Thanks Ray. I once had the same problem a few weeks ago and it really bugged me till I got BartPE. It works too.
hmm good tutor thanks i like it
Thanks mate, wonderful tip and nicely written tutorial, cheers!
Thanx so much Raymond for this tip. Btw based on all my personal experience, in most of cases you dont have to reboot after editing Windows registry. Just log off then log on or sometimes (in some other cases) restart explorer.exe (by using task manager) is surely enough as well. however they all require administrator account/previlege. Anyway, thx again.
Hey Ray,
Another good tip. Thanks man, you are awesome.
I’ve tried a prog “Reimage”. It offered boot CD similar to Knoppix or UBCD4Win.. Its not bad too.
nice tutorials thanks ray!
If you chose the program RegEdit(remote), this is the next line on the menu, it will auto load the hives :)
MiniPE is also a choice.
It has Avast! Registry Editor.
Thanks Raymond.
thanks for the wonderful tips. I don’t want to be bugging you but I did explain why I wanted to download the site and there’s no reply yet. If you’re not fine with it just tell me NO and I will not ask u again.
Anyways thanks and cheers :)
Bye