#!/usr/bin/perl use strict; use warnings; system('for %f in (\\\\testserver\\dir\\*) do echo %f >> testrpt.txt && type %f >> testrpt.txt');