Hey dude, shutdown the machine, enough of surfing. Oops ! but the dude is sleeping!

Last night, i had a situation. A download was running on my Windows Server 2003 machine. But i had to retire for the bed and shutdown the machine after two hours. The command line interface permits to shutdown machine till a maximum of ten minutes* delay only. Hence, i started surfing the web for some auto shutdown timer softwares. But apart from giving fancy multicolored buttons for reboot and standby, i got nothing useful. Then i came up with the following.

File – shutdown.pl
——————————————————————–
#! /usr/bin/perl
sleep(5400); # time in seconds after which you want to shutdown.Its 5400 seconds here or 90 minutes.
system(”shutdown /s /t 00″);
———————————————————————————–
Run the program as perl shutdown.pl
And my job was done. However there might be more smarter ways to handle the situation.


__________________________________________________________________________________

*type shutdown on windows server 2003 command prompt and read carefully

Google Reader Yahoo Facebook Twitter Digg FriendFeed Delicious Google Translate

Read More
  • No Related Post

This entry was posted onJune 1st, 2007 at 10:46 am. You can follow any responses to this entry through the RSS 2.0. You can Leave a response, or Trackback.

6 Responses

Comments(6)Trackbacks(0)

  1. Mohit Ranka

    Rakesh, seems like I am the only one vella enough to read your blog….

    PS – Story isn’t too different on my blog too :(

    Visit it on http://mohitranka.wordpress.com

    June 3, 2007 6:38 pm | #1
  2. rakesh

    ha h a… know dude. its not the case. Many people read it. Check the older posts …

    June 3, 2007 6:40 pm | #2
  3. Devil's Advocate

    i guess u cud hav used normal shutdown command with certain parameters.. m not sure abt server2003.. but it wrks pretty well on xp.. :)

    June 20, 2007 9:37 am | #3
  4. rakesh

    @devil
    ya dude. but it allows only till 10 minutes time … i have mentioned that !

    June 20, 2007 5:22 pm | #4
  5. Thejasvi Bhat

    Looks like it is the OS , In XP , shutdown -t “time in seconds” works . And it works for more than 10 minutes also.
    shutdown -s -t 5400 -c “I am shutting down , this message cant be removed”

    December 1, 2009 2:07 am | #5
  6. Rakesh

    @Thejasvi that limit is in Server 2003 . You did not follow “*” :)

    December 1, 2009 2:18 am | #6

Leave a Reply

(Ctrl+Enter)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>