in reply to Re: Re: Windows Scriptin Host & OLE.
in thread Windows Scriptin Host & OLE.

Ignore my previous post PLease....

It was too simple I just needed to read your codes a little bit closer, Below is how I did it, it seems to be working

Thanking you all.
AUTOLOAD; require 5.006; $|++; use strict; use warnings 'all'; use diagnostics; use Win32::OLE qw[in]; my $fso = Win32::OLE->new( 'Scripting.FileSystemObject' ); my @folders = $fso->GetFolder( $ARGV[0] ); 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";
Aaaaouch, Lost a point and that really hurts...Well losing points here on PerlMonks is helping me to be less lazy...

Great Spirits have always encountered violent opposition from mediocre minds. ******************************************************************