No, you misunderstood what I was saying. I was replying to this:

In general, on a windows machine, you need to specify a binary executable. So you can't run .bat files directly.
Which may be true in general of windows but isn't true of Perl's system(). Because:
Fortunately, command.com does know how to run .bat files. So if you change your call to:
system ("command.com /c d:\webmaster\cgi-bin\comb.bat");
Well, that is the bit that "Perl already does that for you and does a better job of it". Perl already knows how to run command.com (or cmd.exe, depending on which version of Windows is involved) in order to execute programs that Win32's CreateProcess() call doesn't know how to run directly.

Now, the bit of code quoted above made the same mistake you did. You need to double the backslashes in it.

And I have no problem using system to run Windows batch files. If you have already tried doubling the backslashes and it still didn't work, then perhaps you should give us more details about how that failed and even include cut'n'pasted output from something like "dir d:\webmaster\cgi-bin\comb*" and what version of Perl you are using.

        - tye (but my friends call me "Tye")

In reply to (tye)Re2: How do I run a .bat file? by tye
in thread How do I run a .bat file? by Etelka

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.