A non-perl solution would be to take advantage of the "start" command that is available from the Windows command prompt. This command opens a new command prompt, runs a command in that new command prompt, and will by default immediately return control back to the original command prompt.

For example, if you open a command prompt and run the following:

start "test" dir c:

You should see a new command prompt get opened with the title of "test" and in the command prompt the command "dir c:" was run. Also, the original command prompt does not wait for the newly created command prompt before going back to waiting for user input.

So if you use the combination of system() (or back ticks) along with the "start" command, you should be able to accomplish what you want. Might not be the "best" way to do things, but should still enable you to issue command prompt commands from Perl and not wait for that command to finish before your code continues on.


In reply to Re: To run win command with perl with no wait for process to complete and perl to continue furher by dasgar
in thread To run win command with perl with no wait for process to complete and perl to continue furher by Selva123

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.