Monday, September 15, 2008

Good Night !! Sweet Dreams !!

Nowadays I have cultivated a new habit of listening to some soft romantic songs or some instrumentals before sleeping .However most of the time I end up allowing the songs to go on the whole night as I am either fast asleep or too lazy by that time to shutdown my computer . This led me to search for some way to shutdown my computer at a specified time .And here I am with a simple working solution :

If you use XP ,you need not worry at all .All you have to do is go to the Dos Prompt and type this :
at 23:30 shutdown -s
Here 23:30 is the time at which you want the PC/Laptop to shutdown .

In case of Windows Vista I was facing some problem .As soon as I gave this command I was getting an access denied error ,even though I had logged-in as an administrator .So I figured out a work around .I created a Batch file in which I wrote the same command (To create a batch file all you have to do is open the Notepad,type this command and save it as a batch file *.bat).Then right click on this file and say "Run as administrator" . And you are all set !!!
This can also be used in Office ..in case you want to keep some Test running and want your PC to shutdown at a specified time .

Note1 : In case you want to abort the shutdown you can give this command
at 23:29 shutdown -a .This command will abort the system shutdown .
Note2 : Note that shutdown.exe is in one of the folders (normally C:\Windows\System32) listed in the %PATH% environment variable. Other commands will require the full file path
Note 3: I am sure there must be a better way to do it ,in case there is please do let me know .

4 comments:

Anonymous said...

This is very helpful information....Thanks for letting me know.....Now I can keep my test running in office and shutdown my PC at night when test is done....Thanks buddy :)

Anonymous said...

That is coooool dude.....This gave me very valuable information and guess what! it helps in energy conservation also(US, India and rest of the world :P )....

Denila said...

tu techie blogs kab likhne laga??!

Unknown said...

@Deni : Don't forget I am supposed to be an Engineer :P