Programming a Power Button in XP?

legocitytruck

Senior member
Jan 13, 2009
294
0
0
Currently I am using my laptop as my primary computer. It is hooked up to a monitor, keyboard, and mouse, and it stays predominantly closed. It is a few year old Dell running XP SP2.

It is possible to program a sequence of keystrokes to act as the power button or hibernate button? It is a pain to open it and hit the power button and cycle through the screen output settings every time I need to use the computer. Thanks
 

Dahak

Diamond Member
Mar 2, 2000
3,752
25
91
you can see what option you want with the shutdown command or psshutdown from the sysintrernals pack and customize it to what you want to do

PStools

so for shutdown you would have psshutdown /f /t 5
so for shutdown and hibernate psshutdown /f /h /t 5

/f = force
/h = hibernate
/t = delay time in seconds
 

armstrda

Senior member
Sep 15, 2006
426
0
0
Wait, I'm confused... You want it to act as a power button, or are you trying to wake the system with this? I'm assuming by your last line that you're trying to wake the system from S4 (hibernate). If that's the case, you need to check in the BIOS to see if it supports wake from S4 via USB or PS2. You would have better luck for PS2 wake from that deep of a sleep. S3 (suspend) should be able to wake from either USB or PS2.


One more thing... as for the screen output settings, you're referring to getting it to display on your external monitor? You can just set in the BIOS most likely to have the external display be the default monitor, also if you close the lid, most laptops will automatically switch to the external monitor anyway.
 

legocitytruck

Senior member
Jan 13, 2009
294
0
0
Dahak-I will try the PsShutdown. Thank you for the suggestion

armsrada - my ultimate goal is to be able to turn the laptop on with the lid closed from the keyboard which is connected to the laptop via a usb port. The closed lid obscures the power button. The same goes for waking it up from hibernation.
 

armstrda

Senior member
Sep 15, 2006
426
0
0
Chances are an old dell is not going to support wake from S4/S5 on USB. Your other choice would be to see if you can find a port replicator or docking station for cheap on ebay. Those usually have power buttons in them.

And if you want to turn the laptop into a hardware project, you could open it up and wire another button on the side or back of it that would be an additional power button.
 

legocitytruck

Senior member
Jan 13, 2009
294
0
0
armstrda - unfortunately, a docking station is not available for my particular model

Originally posted by: Dahak
you can see what option you want with the shutdown command or psshutdown from the sysintrernals pack and customize it to what you want to do

PStools

I have double clicked on the software icons after extracting but it just opens a ms-dos screen and closes it immediately. It doesn't seem to do anything?
 

Dahak

Diamond Member
Mar 2, 2000
3,752
25
91
i would put the files into the system32 folder from the pstools zip
and then in notepad add the line that you want for either shut down or hibernate
save the file as shutdown.bat (make sure that the .txt extension is not on it) and when you double click it it will do that function
if you want to see all the options go to start -> run -> cmd and click ok
then you can type psshutdown /? for all the options
 

corkyg

Elite Member | Peripherals
Super Moderator
Mar 4, 2000
27,370
240
106
Having a laptop run with the lid closed can be harmful. Many laptops depend on the lid being open in order to get good air circulation through the keyboard which is part of the cooling system. Yours may be OK - but I sure would not do it.
 

dguy6789

Diamond Member
Dec 9, 2002
8,558
3
76
Originally posted by: corkyg
Having a laptop run with the lid closed can be harmful. Many laptops depend on the lid being open in order to get good air circulation through the keyboard which is part of the cooling system. Yours may be OK - but I sure would not do it.

I've never heard of this. Tons and tons of people run their laptops closed and connected to an external monitor, mouse, and keyboard when not on the go.
 

corkyg

Elite Member | Peripherals
Super Moderator
Mar 4, 2000
27,370
240
106
To be safe, put the laptop on a 3rd party cooling pad. In some laptops, the keyboard is a heat sink by design.
 

armstrda

Senior member
Sep 15, 2006
426
0
0
Yeah, I wouldn't think that's the case. If it were then you would feel either air flow or heat coming out of your keyboard. None of the 25+ laptops I've used over the last 10 years have had this happen.
 

Dahak

Diamond Member
Mar 2, 2000
3,752
25
91
you can see all the options for the psshutdown when you open up start -> run -> cmd and click ok
and then do psshutdown /? will show you all the options.
 

armstrda

Senior member
Sep 15, 2006
426
0
0
Either way, that script will not allow you to turn the machine back on after it's shut down / in hibernate.