Results 1 to 15 of 15

Thread: Scheduled Task: Shut down

  1. #1
    Member Ki!ler-Mk1's Avatar
    Registered
    Apr 2005
    Location
    Boston, England
    Posts
    2,013

    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.

  2. #2
    Member westy's Avatar
    Registered
    Aug 2006
    Location
    USA
    Posts
    444
    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).

  3. #3
    Member Ki!ler-Mk1's Avatar
    Registered
    Apr 2005
    Location
    Boston, England
    Posts
    2,013
    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.

  4. #4
    Member Ki!ler-Mk1's Avatar
    Registered
    Apr 2005
    Location
    Boston, England
    Posts
    2,013
    Well, shutdown.exe doesnt work.

  5. #5
    Member westy's Avatar
    Registered
    Aug 2006
    Location
    USA
    Posts
    444
    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).

  6. #6
    Member FixXxeR's Avatar
    Registered
    Jan 2003
    Location
    UK, Manchester
    Posts
    4,055
    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

  7. #7
    Member Machine's Avatar
    Registered
    Jan 2003
    Location
    TuF Forums
    Posts
    5,829
    Shutdown.exe works. I use it after jkdefrag.
    ~TuF~

  8. #8
    Member Moses2k's Avatar
    Registered
    Oct 2004
    Location
    Was actually here before Fuzz
    Posts
    5,674
    I hearby rename this thread:

    Scheduled Task: Alien Swarm

  9. #9
    Member
    Registered
    Jan 2003
    Location
    In the conservatory with the lead pipe.
    Posts
    1,374
    Quote 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; 6th Jul 2009 at 01:35 AM.
    Hippopotomonstrosesquippedaliophobia, n. See also Irony.

  10. #10
    Member Machine's Avatar
    Registered
    Jan 2003
    Location
    TuF Forums
    Posts
    5,829
    n1 salvage, decent little trick that!
    ~TuF~

  11. #11
    Member Baz's Avatar
    Registered
    Jan 2005
    Location
    0xbaadf00d
    Posts
    3,094
    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.

  12. #12
    Member Machine's Avatar
    Registered
    Jan 2003
    Location
    TuF Forums
    Posts
    5,829
    Sleep is in the windows 2003 resource kit. Seperate download from MicroCrap.

    ~TuF~

  13. #13
    Member Ki!ler-Mk1's Avatar
    Registered
    Apr 2005
    Location
    Boston, England
    Posts
    2,013
    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?

  14. #14
    Member westy's Avatar
    Registered
    Aug 2006
    Location
    USA
    Posts
    444


    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).

  15. #15
    Member Moses2k's Avatar
    Registered
    Oct 2004
    Location
    Was actually here before Fuzz
    Posts
    5,674
    I second Westy's comment; it's the advice I usually give.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 17
    Last Post: 17th May 2009, 02:46 PM
  2. Website scheduled updating (kinda technical)
    By Chainsaws in forum Troubleshooting & Technical Help
    Replies: 4
    Last Post: 1st Nov 2005, 01:51 PM
  3. My Computer Wont Shut Down (really)
    By onecrazymoho in forum Troubleshooting & Technical Help
    Replies: 34
    Last Post: 22nd Sep 2004, 10:18 AM

Posting Permissions

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