I have a script to automatically open the IE browser and capture 200 html files. For some reason, after it run 70 html file, it stopped bringing up IE. I could not figure out what went wrong.

The following is my perl script(Active perl, run on the window7):

$file=""; $name=""; $string=""; opendir(CURR,"C:/script") or die "Can't open directory: $!\n"; while(defined($file = readdir(CURR))) { if($file =~ m/(.*)\.html/) { $name = $1; print "name is $name;\n"; print "$file\n"; $capture_cmd = "C:/nircmd/nircmd.exe savescreenshot c:/script/ +$name.png"; $kill_cmd = "C:/nircmd/pskill.exe iexplore.exe"; print "string is $capture_cmd\n"; system (1, "C://iexplore.exe", "-k", "file:///C:/script/$file" +); #for IE sleep 2; if (system ($capture_cmd) != 0) { print "system command failed"; } if (system ($kill_cmd) != 0) { print "kill command failed"; } sleep 10; } } closedir(CURR);

In reply to Perl on window7 by dolly2011

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.