Announcement

Collapse
No announcement yet.

Scheduled Task: Shut down

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

  • Scheduled Task: Shut down

    Hi, does anyone know how to schedule a task to shut down a windows xp machine correctly(eg the same as if you press "windows"+"U"+"U"), and weather this would be done by targetting a batch file using the scheduled task system or some other program built into windows?

    I have found an executable located in the windows folder "shutdown.exe". but im not prepared to run it unless it does that infact.

    EDIT: Where has the delete thread button gone?

    Ah what the hell, gona try it tonight, see what happens.
    Alien Swarm Map List

  • #2
    Code:
    shutdown -s -t 99
    Shuts the computer in 99 seconds

    Code:
    shutdown -a
    Aborts a shutdown.

    Use /? for full syntax.
    Kept an xmas avatar for 3 year(s).

    Comment


    • #3
      Is that for a batch file or to type in cmd.exe eg 3600 seconds for 1 hour?

      Also, i set a task for 4 am today, but while i was afk for the last 70 minutes my pc restarted, could this have been related.
      Alien Swarm Map List

      Comment


      • #4
        Well, shutdown.exe doesnt work.
        Alien Swarm Map List

        Comment


        • #5
          It should work in a batch or in a command window, windows run etc

          The time is only the number of seconds the dialog appears on the screen. And it doesn't work if it's more than 99 seconds.

          You can put it in a batch file or run it on it's own.

          Putting it in scheduled tasks as "shutdown -s -t 99" on it's own works.
          Kept an xmas avatar for 3 year(s).

          Comment


          • #6
            Batch files are win!
            -TuF- Emptying clan servers of their own clan members since 2010
            - Agg moderator campaign supporter 2011
            - #2 of 3 LANers of the Apocalypse!
            -YT

            Comment


            • #7
              Shutdown.exe works. I use it after jkdefrag.
              ~TuF~

              Comment


              • #8
                I hearby rename this thread:

                Scheduled Task: Alien Swarm

                Comment


                • #9
                  Originally posted by westy View Post
                  It should work in a batch or in a command window, windows run etc

                  The time is only the number of seconds the dialog appears on the screen. And it doesn't work if it's more than 99 seconds.

                  You can put it in a batch file or run it on it's own.

                  Putting it in scheduled tasks as "shutdown -s -t 99" on it's own works.
                  If you want more than 99 seconds use the ping workaround on an earlier line of a batch:

                  PING 1.1.1.1 -n 1 -w 5000 > NUL would be 5 seconds(I use this one all the time)
                  PING 1.1.1.1 -n 1 -w 3600000 > NUL would be one hour(testing to see if it works right now - edit: it does)
                  Last edited by Salvage; 6 Jul 2009, 01:35 AM.
                  Hippopotomonstrosesquippedaliophobia, n. See also Irony.

                  Comment


                  • #10
                    n1 salvage, decent little trick that!
                    ~TuF~

                    Comment


                    • #11
                      An even better trick was the magical disappearance of sleep. Another wonderful bit of magic by the Magnifico Microsofii.

                      "Guys, lets get rid of sleep.exe, it's causing too much bloat"
                      ..it's safer here.

                      Comment


                      • #12
                        Sleep is in the windows 2003 resource kit. Seperate download from MicroCrap.

                        ~TuF~

                        Comment


                        • #13
                          Can anyone give me all the [code] for for a batch file that if run by the task schedular will turn the pc off, in a way that doesnt involve restarting?
                          Alien Swarm Map List

                          Comment


                          • #14


                            Down.bat
                            Code:
                            shutdown -s -t 99
                            Or if you don't want the timer, take the "-t 99" out.

                            If you computer IS restarting instead of shutting down it's because you have problems with the power management setup, or your power supply, or your installation of windows is borked.

                            See: http://www.aumha.org/win5/a/shtdwnxp.php

                            Especially...
                            Most Win XP shutdown problems reported thus far have been that it reboots when shutdown is attempted. This may be a global symptom emerging from several distinct causes, because, by default, XP executes an automatic restart in the event of a system failure. Therefore, more or less anything compromising the operating system during the shutdown process could force this reboot.

                            Disabling the “restart on system failure” feature may permit the exact cause to be isolated: Right-click on My Computer, click Properties, click the Advanced tab. Under “Startup & Recovery,” click Settings. Under “System Failure,” uncheck the box in front of “Automatically restart.”
                            Kept an xmas avatar for 3 year(s).

                            Comment


                            • #15
                              I second Westy's comment; it's the advice I usually give.

                              Comment

                              Working...
                              X