Thursday, December 23, 2010

How to change your Windows password from a Linux CD

If you've forgotten your XP logon password, or you got a hand-me-down computer from a friend or relative who forgot to tell you the password to log on, you might think you have to reinstall Windows to get in. Not if you have a Ubuntu 9.10 Live CD or Ubuntu 9.10 on a bootable flash memory drive. Here's what you need to do (based on 32 bit version of Ubuntu):

1. Boot up Ubuntu and click System | Administration | Synaptic Package Manager.
2. In the Synaptic Package Manager window, click Settings | Repositories.
3. Check the box that says "Community-maintained Open Source software (universe)."
4. Click the Close button.
5. You'll see a dialog box that says "Downloading Package Information," then "Rebuilding Search Index."
6. When you get the Quick Search box, enter chntpw in the Quick Search field and click Search or hit Enter.
7. When chntpw shows up in the search list, click its checkbox and click "Mark for installation."
8. Click the Apply button.
9. Click Apply again to confirm what you want to do.
10. When you see "Changes applied," chntpw is installed. Close the Synaptic Package Manager.
11. Back on the Ubuntu desktop, click Places in the top left and under Computer, click the drive where Windows is installed. Note the drive label.
12. Click Applications | Accessories | Terminal to open a terminal window.
13. At the prompt, enter the following, pressing Enter after each line:
cd /media
14. Change to the directory with the same name as the hard drive label you noted before, using the command:
15. Now switch to the correct directory on that drive by typing this command:
cd WINDOWS/system32/config/
16. To change the administrator password, first type:
sudo chntpw SAM
17. This displays the SAM file, which includes a list of the user accounts.
18. You'll see the "User Edit Menu," which gives you four choices. The first is to clear the password (make it blank). To do this, enter 1 and then when asked to confirm (y/n), type y.

You can change the password instead of clearing it by choosing 2, but it's easier to just make it blank, log onto Windows, and set a new password within Windows. It might all seem like a bit of a hassle, but it beats reinstalling Windows and losing all the programs that are installed on the computer.