Hi All

I usually play a movie in my PC before I sleep and as everyone i dont know when I sleep and till next day morning the movie keeps on looping.

I usually get scoldings for keeping the PC ON the whole night.

I decided to avoid scoldings and recently wrote a too small PERL script which would shutdown when i sleep ( although i know i can do it without PERL too using shutdown.exe - t XX but i want to run everything on PERL hereafter). The code goes something like this ...
sleep 1800; # am sure to sleep in half an hour system "c:\\windows\\system32\\shutdown.exe -s";
But I did find that the shutdown occurs without closing applications and during the next start Windows checks for errors quoting improper shutdown.

Actually I want to do something like -

1) Close the Windows Media Player which is running the video.

2)Then shutdown

I consulted me friend and he is telling that to close windows media player i need to track process id or pid , Is that necessary ?

Also how do i close other folders using perl and make a safe shutdown.

Regards

prad

2005-09-27 Retitled by g0n, as per Monastery guidelines
Original title: 'perl help while sleeping !'


In reply to Using Perl to shutdown windows by prad_intel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.