Announcement

Collapse
No announcement yet.

Killing Windows

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Killing Windows

    I am trying to get windows to automatically shutdown, when exit my MP3 player, I'm currently using a batch file which executes rundll32.exe, however this causes problems as it cann't shutdown while the batch file is running, any ideas on how to force shutdown.

    Rob
    And you say people actually pay money for M$ Windows?
    www.mp3mini.co.uk (Does what it says on the URL) www.openclassic.co.uk (The new car, with zero rust!) www.rob-web.co.uk (My other site)
    Total re-design underway: on the whole progress is very slow as the car is taking up too much time :)

  • #2
    how is the batch file called? does the program call it? do you click on it? if you trigger it yourself you could just create a desktop shortcut to rundll32. i guess i dont completely understand your situation.
    Athlon 500, 128 MB, ATI Xpert 4MB AGP TV-Out, Sound Blaster Live! Value, 8.4 GB, 2x20 Backlit LCD, Keypower 250 Watt ATX DC-DC, DSchmitd Startup/Shutdown Controller, IRMan + Backlit IR Remote, Custom Keypad, 5.6" NTSC LCD, In-Dash Slot Loading DVD, all installed in an '87 Honda Accord LX-i

    Comment


    • #3
      THe bacth file is in the start up folder so it is automatically run when windows loads, it runs my mp3 decoder (winamp at present) then when that is exited it executes rundll32.exe below is a copy of the bat file's contents if it helps.

      -----------------------------
      start /wait winamp
      start /wait rundll32.exe user32.dll,ExitWindowsEx 5,0
      ------------------------------

      The problem seems to be due to the fact that rundll32 can't shut down, as the batch file is still open, is there any way around this, ie forcing shut down. NB, I'm not using a keyboard or mouse so I don't want hot keys.

      Rob
      And you say people actually pay money for M$ Windows?
      www.mp3mini.co.uk (Does what it says on the URL) www.openclassic.co.uk (The new car, with zero rust!) www.rob-web.co.uk (My other site)
      Total re-design underway: on the whole progress is very slow as the car is taking up too much time :)

      Comment


      • #4
        what if you got rid of the /wait in the rundll statement? it seems logical that if you keep the wait in there, it will wait for windows to shut down before ending the batch file, and this is an impossible situation. however, if you get rid of the /wait, the batch will immediately terminate and the rundll should be successful.
        ghetto suitcase player: http://www.mp3car.com/usersites/nipkick

        Comment


        • #5
          You may want to check for winamp plugins, I'm not sure, but I think there are several that include shutdown features. The plugin I used for remote control supported shutdown.

          just my 2

          Comment


          • #6
            nop, its not winamp pluggin. He needs to get rid of that /wait command. That should do the trik.
            abcd-1
            Author of CobraI,II,III and now CobraIV.
            You can contact me on AOL instant messenger....nick is cenwesi or cenwesi3

            Comment


            • #7
              You can make a little application in VB or some other language that calls the ShutDownWindows() API. There is a parameter that allows you to forcefully shut down Windows, no matter what the OS or applications are doing.
              Player: Pentium 166MMX, Amptron 598LMR MB w/onboard Sound, Video, LAN, 10.2 Gig Fujitsu Laptop HD, Arise 865 DC-DC Converter, Lexan Case, Custom Software w/Voice Interface, MS Access Based Playlists
              Car: 1986 Mazda RX-7 Turbo (highly modded), 1978 RX-7 Beater (Dead, parting out), 2001 Honda Insight
              "If one more body-kitted, cut-spring-lowered, farty-exhausted Civic revs on me at an intersection, I swear I'm going to get out of my car and cram their ridiculous double-decker aluminium wing firmly up their rump."

              Comment


              • #8
                Don't forget to make your batch file exit:
                http://www.computerhope.com/issues/ch000321.htm

                Also, if you have Win98 you may want to call shell32.dll instead of user32.dll. Play with various incarnations listed here:
                http://www.robvanderwoude.com/shutdown.html

                Comment


                • #9
                  Cheers, I'd already tried removing the wait command but that just made thinks go Pete Tong, but the alternative lines for the batch file work like a dream!
                  And you say people actually pay money for M$ Windows?
                  www.mp3mini.co.uk (Does what it says on the URL) www.openclassic.co.uk (The new car, with zero rust!) www.rob-web.co.uk (My other site)
                  Total re-design underway: on the whole progress is very slow as the car is taking up too much time :)

                  Comment


                  • #10
                    Which one did you end up using and what OS are you running? (for future reference to others on the board)

                    Comment


                    • #11
                      For referance the batch file is below, and the OS is WIN98

                      -----------------------------
                      start /wait C:/winamp/winamp.exe
                      RUNDLL SHELL32.DLL,SHExitWindowsEx 1
                      ------------------------------
                      And you say people actually pay money for M$ Windows?
                      www.mp3mini.co.uk (Does what it says on the URL) www.openclassic.co.uk (The new car, with zero rust!) www.rob-web.co.uk (My other site)
                      Total re-design underway: on the whole progress is very slow as the car is taking up too much time :)

                      Comment

                      Working...
                      X