Most of the time you need to edit windows registry to solve windows problem. But what you will do if your windows is not getting loaded, you will search for software or live cd of a program to fix you registry. But no need of doing this if you have Ubuntu live cd or Ubuntu on another partition. To access windows registry boot your need to boot your machine in Ubuntu
Please note use this utility on your risk. I have tested chntpw on Ubuntu 11.04 with Windows XP SP 2.
Install chntpw utility
sudo apt-get install chntpw
Mount Windows partition:
Find the Windows partition:
sudo fdisk -l
Assume it is on /dev/sda1. Next step is mounting of the partition:
sudo mkdir /media/windows sudo mount /dev/sda1 /media/windows
To go in proper hive you must know the Hive name. For same please refer following table.
Registry Key Name Hive Filename HKEY_CURRENT_USER NTuser.dat HKEY_LOCAL_MACHINE\SAM SAM HKEY_LOCAL_MACHINE\SECURITY SECURITY HKEY_LOCAL_MACHINE\SOFTWARE SOFTWARE HKEY_LOCAL_MACHINE\SYSTEM SYSTEM HKEY_USERS\DEFAULT DEFAULT
For eg. you need to go HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes and change the Start value to 4.
then do as follows
chntpw -l /mnt/sda1/WINDOWS/system32/config/system
At the new command prompt type ? to see various commands used for registry editing. Most useful commands are dir,cat,cd,ed etc.
Now type ‘dir’ command to see all the subkeys under the root key. You will see many ControlSet00* keys under this, but where is the CurrentControlSet key. We need this subkey to edit properties of Themes service..!
Well, don’t be panic. The answer is hidden in ‘Select’ subkey. Now enumerate all the values under ‘Select‘ subkey as shown below.
cd Select dir
Now the value associated with ‘Current’ subkey will tell you which is the currently used ControlSet00* key. For example if the ‘Current’ has value 2 then that means you have to select ‘ControlSet002’ etc. On my machine the ‘Current’ has value 1. So I am going to select ‘ControlSet001’ key.
Know we know which controlset we have to use for our purpose. Now select it and move on to Themes subkey as shown below. Note that we are under Select key. You have to go back to root key to choose the ControlSet key.
cd .. cd ControlSet001\Services\Themes
Now type ‘dir’ command to see all the names and their values under this key. We have to just change DWORD value of ‘Start’ to 4 using the ‘ed’ command.
When you are prompted to enter new value, just type 4 and press ‘ENTER’ to set the new value.To verify use the below shown command.
Once you have modified all required changes, type ‘q’ to quit the registry editor and then press ‘y’ to save your changes. After that restart the system and you should be able to login normally without any problem.