Reboot to Safe Mode, select Administrator, leave password blank.
Then go to User Accounts in Control Panel.
Select the user and change the password.
If you are using Windows XP Pro and have encrypted data, you may
permanently lose access to the encrypted data.

Here are other options:

Another option is to install Windows XP on another partition and take
Ownership of your data.
You could also perform another installation on the same partition,
although this is not a permanent fix and it is recommended to perform
a Clean Installation after retrieving your data.

Jupiter Jones [MVP]
An easier way to read newsgroup messages:
Please respond to newsgroup only for everyone's benefit.

"John McFadden" <> wrote in message
> A friend has a recently purchased, used Compaq laptop
> running XP. He does not know, and cannot find out from
> the previous owner, the password to gain access to the
> machine. Is there a way to bypass (or to learn) the
> password, short of rebuilding the hard drive from scratch?