How to factory restore my iphone, with out a power button?

Ow do i factory restore my iphone, with out a power button? The power button is jammed, and i forgot my password.

You can't. That button is part of the process.

Follow the procedure as follows:
1. Google and download the original and latest iOS firmware for your iDevice. (Ex: "iPod touch 3G 5.1.1″)
2. Wait for your device to completely shut off.
3. Once it's off, hold the Home button.
4. While holding, connect the USB cable to your computer.
5. Your iDevice should now turn it on. Keep holding the Home button.
6. The "Connect to iTunes" mode should show up. You're now in recovery mode.
7. Open iTunes. It should prompt you to restore your device.
8. Open the ipsw firmware file you downloaded and proceed with the next instructions.
Congratulations! You now have a freshly restored iDevice. You may now proceed with your jailbreaking procedure.
And by the way, once jailbroken, never forget to install SBSettings.

Just plug it into itunes and click restore, i didn't have to do anything, i just left my phone and it was fine.

Restoring your iPhone
1. Connect your device to your computer.
2. Select your iPhone when it appears in iTunes under Devices. Select the Summary tab, and click the Restore button.
3. Click Restore.
4. Prompt text: "Are you sure you want to restore the iPod to its factory settings? All of your mnedia and other date will be erased."
5. After a restore, the iOS device restarts. You should then see "Slide to set up". Follow the steps in the iOS Setup Assistant.
6. If needed, restore your device from a previous backup: http://support.apple.com/.../kb/HT1766