#! C:\perl\bin\perl.exe my $file1 = "test1.txt"; system ( "check.bat > C:\\$file1 2>&1" );