use File::Find; use Win32::DriveInfo; for( Win32::DriveInfo::DrivesInUse ) { find( \&handleFind, "$_:" ); } sub handleFind {... same as before ...}