01 June, 2007

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

4 readers commented:

Admin said...

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

rakesh said...

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

Anand said...

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

rakesh said...

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