use strict; use warnings; use File::Copy; # yes, it is Windows XP and a drive letters assigned to a USB and a NAS drive. # Indir and outdir will be a parameter in this format. my $inDir = "M:\\AllFiles"; my $outDir = "n:\\allFiles"; # test 1 straight in out in DOS format. MoveFiles($inDir,$outDir); # test 2 Try within quotes. MoveFiles("$inDir","$outDir"); # test 3 Try selecting ALL files in the directory MoveFiles($inDir."\\*", $outDir); sub MoveFiles { my ( $source, $destination ) = @_; my $source_size = (-s $source) || 0; my $destination_size = (-s $destination) || 0; move( $source, $destination ) if ($destination_size > $source_size); }