View Poll Results: Is this working for you?

Voters
2. You may not vote on this poll
  • Yes, I have Windows XP home

    1 50.00%
  • No, I have Windows XP home

    0 0%
  • Yes, I have Windows XP Pro

    1 50.00%
  • No, Windows XP Pro

    0 0%
  • Yes, I have Windows Vista

    0 0%
  • No, I have Windows Vista

    0 0%
Page 2 of 5 FirstFirst 12345 LastLast
Results 11 to 20 of 44

Thread: Run command when power button pushed

  1. #11
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    718
    I think I can write a program to do this. I just need a couple free hours. I'll try to look into it tomorrow.

    (to be clear, I mean to detect the power button being pressed and run something, delaying the shutdown. not waiting for a process to end.)

  2. #12
    Newbie
    Join Date
    Jan 2009
    Posts
    47
    i just redid some test with the lastchance program

    it's not perfect but it seem to work

    but

    when it install it say a dll could not be installed
    it seem than you can only add program not remove because of this
    sometime the pc was not stoping long enough
    so my first line of command is a delayed shut down shutdown -s -f -t 20

    and it will wait around 20 sec a tried 30 but i will shutdown anyway

    i still have to do some test

  3. #13
    One Sharp Cheddar ThunderStick's Avatar
    Join Date
    Aug 2006
    Location
    West Allis, WI
    Posts
    1,654
    Quote Originally Posted by Injector View Post
    have you tried making a batch file?
    Tried a batch file but am unable to launch it at shutdown and keep the computer from shutting it down. This is my actual problem. I think I can figure out how to launch a command after the shutdown sequence has started. But keeping windows from closing the program before it is completed is another story.
    New Age Garmin - Skin for RR
    New Age Slider - RR SKin In Progress
    "It's called CODE because I don't want you to know"

  4. #14
    Maximum Bitrate Injector's Avatar
    Join Date
    Mar 2005
    Location
    Rockledge, FL
    Posts
    525
    try adding "shutdown -a" to the batch

  5. #15
    One Sharp Cheddar ThunderStick's Avatar
    Join Date
    Aug 2006
    Location
    West Allis, WI
    Posts
    1,654
    giving up on this whole idea of trying to run a script in windows xp home.
    after doing some rigorous searching through google, it has been tried and failed many many times. It's just not possible.
    New Age Garmin - Skin for RR
    New Age Slider - RR SKin In Progress
    "It's called CODE because I don't want you to know"

  6. #16
    Maximum Bitrate Injector's Avatar
    Join Date
    Mar 2005
    Location
    Rockledge, FL
    Posts
    525
    you could always go pro

  7. #17
    One Sharp Cheddar ThunderStick's Avatar
    Join Date
    Aug 2006
    Location
    West Allis, WI
    Posts
    1,654
    That may be the plan, I do have a copy of it. I just hate re-installing windows all the time.
    I was thinking of just disabling any shutdown action at all when the power button is pressed and instead have a script to monitor my system power voltage. The idea is when the car turns off there is a power drop because the alternator is no longer charging. When detected a voltage drop below 12 volts for more than 1 minute it will fire the script and begin my personalized shutdown sequence.
    I can set my PSU to kill the PC after 10 minutes which should give my computer plenty of time to shutdown and complete the script.
    New Age Garmin - Skin for RR
    New Age Slider - RR SKin In Progress
    "It's called CODE because I don't want you to know"

  8. #18
    Vendor - Qube colin's Avatar
    Join Date
    Dec 2006
    Posts
    794
    It is not impossible. I havent checked this thread because I figured someone would have given an answer.

    If any of you have some programming knowledge, trap Windows' messages! Windows tells each program to close nicely, and prior to Vista, the programs had an option as to whether or not they would shut down.

    This caused problems because people would press shutdown and the computer would still be on 5 minutes later before they realized that something went wrong!

    From MSDN:
    "The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.

    After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message

  9. #19
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    718
    That was my plan.. but I've been busy with work. Looking into it now while my wife is on the Wii Fit.

  10. #20
    One Sharp Cheddar ThunderStick's Avatar
    Join Date
    Aug 2006
    Location
    West Allis, WI
    Posts
    1,654
    If someone can create a solution for my it would be greatly appreciated. I am getting pretty good with AutoIT but anyother type of program is still greek to me..
    New Age Garmin - Skin for RR
    New Age Slider - RR SKin In Progress
    "It's called CODE because I don't want you to know"

Page 2 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. 2008 Yaris 4 Door Sedan PC Install
    By rizaydog in forum Show off your project
    Replies: 55
    Last Post: 05-21-2009, 07:03 AM
  2. Utility to change behavior of ATX power button (e.g.: launch an app)
    By justintime in forum Software & Software Development
    Replies: 83
    Last Post: 05-08-2009, 04:45 PM
  3. 2007 Ford Fusion Carputer (version 2.0)
    By FusionFanatic in forum Show off your project
    Replies: 43
    Last Post: 04-20-2009, 04:56 PM
  4. DC-DC Car Power for Mac Mini
    By MikeH in forum MacCar
    Replies: 53
    Last Post: 02-19-2005, 12:13 PM
  5. I want to add a power button on my dash. Which can i use?
    By Sonicxtacy02 in forum General Hardware Discussion
    Replies: 2
    Last Post: 10-25-2004, 03:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •