Windows logs off automatically while login

by Abhishek Bhatnagar on March 22, 2008



We have been receiving mails from several readers that they are not able to login to Windows. As soon as they login, the windows show applying your settings, saving your settings and logs off automatically without logging in. This situation is really very troublesome and gets onto the nerves of a person who needs his computer badly for some important work.

The main reasons behind this problem is a corruption in the registry key which holds the value of the files which are executed while login to windows. This registry key can get either replaced with some incorrect value or it might get corrupt due to some virus / trojan activity. Lets see how to fix this issue.


We need to remotely access the infected computer from another computer on same network. Then we need to correct the registry key for userinit under winlogon.
Lets see the steps one by one:


1. Connect the infected computer to a network which has at least one healthy computer connected. Power on both of the computers.
2. From the healthy computer, Go to Start > Run, type regedit.exe and press enter. This will launch the registry editor.
3. Go to File > Connect Network Registry, by using this infected computer’s name or IP address. For more details on this, see this link.

Remote registry editing

4. Locate this entry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\

5. At this entry there is a key names userinit, double click on the key and set its value to “C:\WINDOWS\System32\userinit.exe,“

Exit the registry editor, restart the infected computer. This is it. This will work for most of the computers.

 For those computers which still don’t let you login, you need to run a repair setup on such computers.To run a recovery setup, see this link.

If you like this article or this article helped you, you can +1 to recommend this article on google plus.

You can follow us on Twitter or join our Facebook Fan Page. If you have a question to ask us, submit your question at Answers By Trouble Fixers.

Looking for something else? Search here :

{ 17 comments… read them below or add one }

Vishwanath Sonna March 31, 2008 at 8:25 pm

Thanks.. I was facing the same problem. I repaired my windows installation and it started working.
But now the problem is appearing every time i restart the machine. please help me fix this problem.

neeraj April 4, 2008 at 10:38 pm

i want to know about windows server2003 ————please tell me

santosh rajbhar March 12, 2009 at 2:27 am

Dear friends

my pc problem is solved it’s very helpfull site

thank very much

praveen April 23, 2009 at 8:56 pm

Dear friends

i can solved that proble,but i am boot through ERD commander 2005 and edit registary.

Prasanna April 30, 2009 at 11:47 pm

Dear Friends,

I am able to connect to the Regedit of the infected PC through the network but was not able to open the HKEY_LOCAL_MACHINE & I was not allowed to open. Is there any other solution to recover the problem without reinstalling OS.

Jyoti Shree July 4, 2009 at 12:25 am

I need to konw about the Windows Server 2003 server. the login window re-appears after giving credentials

ZeePak July 23, 2009 at 10:43 pm

no idea your problem has been solve only reinstallation and update antivirus

Guti September 7, 2009 at 11:49 pm

In most cases where replacing the userinit.exe does not work the reason is quite simple: You fooled around with your hard disk, changed the disk and/or controller. Now when you start Windows, just as you log in the operating system assigns its drive letters. However, due to a changed disk or controller, the drive letters don’t get assigned correctly. They may look right in the recovery console, but standard Windows (as well as Safe Mode) is a different story.
Now you can replace userinit.exe as often as you want, it won’t help, because the file is not broken or corrupt, and not infected either. Windows just can’t find it, because it’s not looking for it on the right drive.

To get this fixed, edit the registry of the system that always logs you off. There are many ways to do this from another system, google for it. There, find HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices , look for entries like \DosDevices\D: etc. Make sure the right drive letters are assigned there. You can do so by comparing this to the system as it was before you made the change (if you still have a backup). If you don’t know for sure which letter was assigned to your system drive, you may just have to try.
Changing the entries works by right-clicking on them, selecting “rename” (in standard regedit) and changing \DosDevices\D: to \DosDevices\C:, for example.

These microsoft articles may help as well, as they explain the issue:

siva April 25, 2010 at 8:27 pm

Configure your computer to start from the CD-ROM drive. For more information about how to do this, refer to your computer’s documentation or contact your computer manufacturer. Then insert your Windows XP Setup CD, and restart your computer.
When the Press any key to boot from CD message is displayed on your screen, press a key to start your computer from the Windows XP CD.
Press ENTER when you see the message To setup Windows XP now, and then press ENTER displayed on the Welcome to Setup screen.
Do not choose the option to press R to use the Recovery Console.
In the Windows XP Licensing Agreement, press F8 to agree to the license agreement.
Make sure that your current installation of Windows XP is selected in the box, and then press R to repair Windows XP.
Follow the instructions on the screen to complete Setup.

Dinesh June 16, 2010 at 12:27 pm

Hi this is Dinesh Here….

In windows xp or other os we can not change some registry values through network.
So in this case I have a solution…..

Make a bootable cd of UBCD.
Boot with that Cd and now you can change registry from here.

Try and tell me if u get success….

Kachinga June 23, 2010 at 2:04 pm

Hi guys. This is what i do.

If u are sure its a virus thats the cause, then use bartpe or windows disk to copy the userinit file to your hard drive. Now here is the trick, after you copy RESTART YOUR PC ONLY IN SAFE MODE, then scan your pc in safe mode. If your system files are damaged, its time to re-install windows (in my case every windows program file was damaged, except for my own programs)

raju July 17, 2010 at 11:25 am


just now i configured the ip address but system is not communicating with other pc..
we tally server & internet server…. ip address is [Interenet] & [tally server]
when ping these two ip address i getting reply but i am not able to see ….
but not getting reply from other pc’s except these two ip address.

waiting for result plz solve my problme

santosh November 2, 2011 at 10:07 pm

Hi guys,

My problem is quite diferent , I have 3 users in my windows7 pc, out of that, usr1 and administrator are able to login , but user2 is unable to login . in this case what should I do to login by user2.
and second question is if I want to access the user2’s internet expolore favorites.

kindly reply me………..


arun February 10, 2012 at 9:18 pm

thanks to u guys … u guys rock man and thank you again for solving my problem HURRAY team TROUBLE FIXERS !!!!!!!

Mosaab February 17, 2012 at 10:01 pm

My windows xp home edition sp3 on Dell mini inspiron, it log off immediately when i log on,
and thats because of 24.01.2007 SURABAYA harmful virus, what’s the solution, is it possible that no one in the world can kick this virus and defeat it.

gizmo March 10, 2012 at 8:49 pm

This worked perfectly!
thank……. you

CmpGenius January 21, 2013 at 7:34 pm

Thanks very much.

It actually worked! lol

Now happy.! :)

Leave a Comment

Previous post:

Next post:

© TroubleFixers – All about fixing computer troubles2007-2016 . All Rights Reserved.