How can you log onto a computer if you forgot your password and its windows 7?

You may reset your password for Windows 7 using several methods. If your computer has joined a domain, you can reset the password from the domain controller (requires a Network Administrator to do this for you). If you have created a password reset disk, you may use that to log in and keep your encrypted files.

Otherwise, if you cannot remember your normal password, and you have a default Windows 7 installation, the Administrator account may be unlocked. Try pressing Ctrl-Alt-Del at the Welcome Screen, and use the name Administrator with no password. If it allows you in, you can use Control Panel to reset your password (note: this may cause you to lose files you've encrypted, permanently).

Finally, if you are not a member of a domain, do not have a reset disk, and you do not have access to the administrator account, you will need to use an unofficial tool, such as System Rescue CD, to recover your account. Some are free, and some cost money, and of course each will have various drawbacks and features. If you are inexperienced with computers in general, it may be best to let a friend, family member, or associate that is knowledgeable with these types of tools perform the fix for you.

Downloading unknown tools from the Internet is a great way to get viruses or have a total loss of all files on the hard drive. Never attempt to repair an operating system using any tool you are not familiar with or comfortable with using, always ask for help before you make an easily fixable situation into an impossible situation.