test.bat -------- dir c:\some\path\ >>c:\path\to\test.txt #### system("c:\path\to\test.bat"); open(OUTPUT, "; close(OUTPUT);