I am trying to use perl to run two different commands - both of which need to be executed in a separate command prompt.
Here are some of the details:
when I run
system('start cmd /k "cd c:\PerlExamples && perl Perl_Ex_1.pl"');
it works as expected - it opens a new command prompt, paths to the directory I need and runs my script.
However, I want to use this system... command in a loop where each time I am running a different example script. But when I run the following lines of code,
my $cmd = "perl Perl_Ex_1.pl";
system("start cmd /k cd c:\PerlExamples && $cmd");
it opens a new command prompt and paths to the directory I need. But it runs my example script in the original window and not in the newly opened command prompt.
Is there a way for me to do this?
Thank you.
/cinstead of/k? I cannot test right now (no Windows available). Or try withoutstart.