use Win32::File; my $path="C:\\temp\\Perl\\TestFolder\\TestFile.txt"; my $attr; Win32::File::GetAttributes($path, $attr); if ($attr & COMPRESSED) { print "File is compressed. Now uncompress it!\n"; $attr &= ~COMPRESSED; Win32::File::SetAttributes($path, $attr); } else { print "File is not compressed. Nothing to do here.\n"; }