#!perl BEGIN { $| = 1; $^W = 1; } use strict; use warnings; use Win32::File qw( :DEFAULT SetAttributes GetAttributes ); my $name = '/root/Desktop/foo.txt'; my $attr = 0; Win32::File::SetAttributes( $name, $attr ); Win32::File::GetAttributes( $name, $attr ); if ( $attr & SYSTEM ) { print "$name has SYSTEM set.\n"; } if ( $attr & HIDDEN ) { print "$name is hidden.\n"; }