AUTOLOAD; require 5.006; $|++; use strict; use warnings 'all'; #use diagnostics; use Win32::OLE qw[in]; use vars qw/@LoH/; for my $Path (@ARGV) { my $Match = {}; my $fso= Win32::OLE->new( 'Scripting.FileSystemObject' ); my @folders = $fso->GetFolder( $Path || die"No 'TargetPath' was found\n" ); my $fss = $fso->GetFolder($Path); $Match->{path} = $Path; my $Size = $fss->size( ); $Match->{size} = $Size ; my ($fCount, $sCount) = (0,0); print "\nPlease Wait"; while( @folders ) { print "."; my $folder = pop @folders; $fCount += $folder->Files->Count; $sCount += $folder->SubFolders->Count; for my $subFolder ( in $folder->SubFolders ) { $fCount += $subFolder->Files->Count; push @folders, $_ for in $subFolder->SubFolders ; $sCount += $subFolder->SubFolders->Count; } } $Match->{files} = $fCount; $Match->{folders} = $sCount; print "\n\n\nSize of $Path = $Size byte\n\nFiles : $fCount, Folders : $sCount\n\n"; push @LoH, $Match; } # From this point and below I am checking if the two paths match - so migration is successfull. exit() if ($#LoH < 1); if ($LoH[0]->{size} == $LoH[1]->{size} && $LoH[0]->{files} == $LoH[1]->{files} && $LoH[0]->{folders} == $LoH[1]->{folders}) { print "\n[ MATCH ]\n"; } else { print "\nNOT MATCHED\n" }