Search your unanswered perl queries
Google

Monday, November 12, 2007

One liner to shutdown a windows pc using perl

To shutdown a pc using perl one can write a one liner at command prompt as below

perl -e "sleep(3600); system('shutdown.exe -s')"

Thats it... the sleep(3600) will make the program sleep for 1 hour i.e 3600 seconds. According one can schedule the shutdown delay and have a peacefull sleep or walkaround in the park.

No comments: