I have run across this issue from time to time when removing spyware and viruses off of a windows XP machine.  In the past I have been so frustrated at this problem that I ended up reformatting and installing an OS.  The good news is that this problem is now easily fixable with free tools available online.  First off this problem is typically caused by malicious software altering a specific registry key.  This Registry key is

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

Under this there is an entry for Userinit

What typically happens is that although the virus software has removed the offending software this value is left set at

Userinit = C:\Windows\System32\Winlogon82.exe  (or some other virus)

This value needs to be set to

Userinit = C:\Windows\System32\userinit.exe

The tricky part now becomes how do you adjust the registry of a windows machine that will not allow me to login even in safe mode.  There is where the Offline NT password and Registry editor becomes useful – visit http://pogostick.net/~pnh/ntpasswd/ and download and burn the a CD boot image of this product (or floppy boot image if you have an old school machine).

Or you can download directly from here below – T his is a Zip file of the ISO.

Offline NT Password and Registry Editor Version 080802.zip

This version allows you to view and change the registry from a command line – simply navigate to the affected key and then change with the value listed above and the problem is fixed.