Run a command instead of shutting down the PC? [duplicate]

When pushing the physical power button, can Windows execute a command (like notepad.exe) instead shutting down the PC?