in reply to Re: executing commands in cmd using perl
in thread executing commands in cmd using perl

I have to first open cmd.exe and then execute command in cmd ,could you give me a small example please .
  • Comment on Re^2: executing commands in cmd using perl

Replies are listed 'Best First'.
Re^3: executing commands in cmd using perl
by kennethk (Abbot) on Dec 30, 2014 at 17:21 UTC
    If I'm understanding what you are asking (which seems unusual), your query is answered at stackoverflow. Example
    system 'start cmd.exe @cmd /k "Command"';
    Of course, that second bit isn't actually a Perl question.

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Re^3: executing commands in cmd using perl
by Laurent_R (Canon) on Dec 30, 2014 at 18:59 UTC
    Are you sure you need to open cmd.exe and then execute a command in it? Perl can issue a command to windows, even run a dos/windows .bat file without having to run cmd.exe. Perhaps you should tell a bit more specifically what you want to do rather than asking us how to do it the way you think it might be done. This looks like a case of XY Problem.
      You are right man.But thanks for the support of the perl monks community I got the work done.In future before asking something from you guys I will take care of the xy problem that you mentioned.