The default action for the Power button on the start menu in Windows 7 is shutdown, and in Vista is Sleep, which isn't necessarily useful for everybody, so we'll explain how to change it here.

Change Windows 7 Shutdown Button

Windows 7 makes it really easy - just head into the Start Menu / Taskbar preferences by right-clicking on the start menu and choosing Properties.

All you need to do is change the drop-down for Power Button Action to whatever you would prefer.

Change Windows Vista Power Buttons

You can configure this setting easily by using the advanced power settings panel, which is a little tricky to get to normally, but we'll take the shortcut. Open a command prompt (type cmd into the start menu search bar), and then type in the following:

powercfg.cpl,1

You could also take the long route (Control Panel \ Power Options \ Change Plan Settings \ Change Advanced Power Settings) Once you get to this dialog, browse down as shown to "Power buttons and lid"

From here, you can change the options:

You can change the power button to either Sleep, Hibernate or Shut Down, or even nothing for the hardware power button.