echo XXXXXXX >X_%2.log 2>&1 sleep 5 #### use strict; use warnings; my $cmdline="cmd /c testing.bat AA 1"; my $child_pid=system(1,$cmdline); print "$child_pid\n"; wait; print "Finished\n"; exit; #### C:\Users\rofischx\playground>perl testing.pl 4864 C:\Users\rofischx\playground>echo XXXXXXX 1>X_1".log 2>&1 The filename, directory name, or volume label syntax is incorrect. C:\Users\rofischx\playground>sleep 5 Finished