$|++; AUTOLOAD; use strict; use warnings 'all'; use diagnostics; use Win32::OLE qw[in]; use threads; use threads::shared; my $fso = Win32::OLE->new( 'Scripting.FileSystemObject' ); my @childs; my @up: shared; for (@ARGV){ print "\n$_\n"; push @childs, threads->create("Process_path","$_"); #Process_path($_); } foreach my $child (@childs){ $child->join(); } print @up; sub Process_path{ my ($path) = @_; my @folders = $fso->GetFolder( $path); my $FSize = $fso->GetFolder($path); my $Size = $FSize->size(); print "Size: $Size\n"; my $fCount =0; my $sCount =0; while( @folders ){ 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; }} print "Files : $fCount, folders : $sCount\n"; push (@up, $path.": ".$Size.": ".$fCount.": ".$sCount."."); } #### Free to wrong pool 1a9e940 not 223f80 at C:\Scripts\threads4_wsh.pl line 29. Free to wrong pool 1ab0998 not 223f80 at C:\Scripts\threads4_wsh.pl line 15.