in reply to Re: Re: How do I search for a specific directory on a remote PC?
in thread How do I search for a specific directory on a remote PC?

I decided my reply was incomplete, given the exact question you had. Here's some code that does it.
use File::Find; use strict; our $belowpath = "common files"; our %found_dirs; find( \&foobar, 'c:/program files'); sub foobar { if ( $File::Find::dir =~ /$belowpath$/i && -d $_ ) { my $found = "$File::Find::dir/$_"; $found =~ tr/\//\\/; print "$found\n"; } }
This prints:
c:\program files\Common Files\Network Associates c:\program files\Common Files\Adobe c:\program files\Common Files\InstallShield c:\program files\Common Files\Symantec Shared c:\program files\Common Files\Services c:\program files\Common Files\System c:\program files\Common Files\ODBC c:\program files\Common Files\Microsoft Shared