Open Control Panel and select Power Options, then on the left side click on Choose what the power button does.

Then click on the dropdown box and select Do Nothing from the menu and click on Save changes.

From the dropdown list you can also select Shutdown, Sleep or Hibernate. But, if you are annoyed when you accidently hit the button and it shuts down, choosing Do Nothing will keep it running.