Thanks shawn i got that working ,
But during shutdown the computer went to the log on screen and was asking for password there.Is there any way i can disable that option ? I have chosen a option to shutdown when the pc is idle for more then an hour.
Because at night sometimes i leave my laptop switch on and i want it to shut down automatically and not ask for the password .