use Win32::Service; my $filedir = "\\\\10.1.1.5\\Weblogiclogs"; my $IWlogs = "\\\\10.1.1.5\\Weblogiclogs\\*.log*"; # Get Local Time and Create folder based on local time stamped # This is a much easier way of creating your directory name my $createdir = strftime( '%y%d%e%H%M%S', localtime); # Create folder based on local time obtained above # - This is where the script is erroring out at.... if(!-e $createDir) { # NOTE: The $! & $^E will tell you WHY it failed. mkdir $createdir or die "Couln't create $createdir because $!($^E)\n"; } # move logs files to new created directory named after # the local time. @args = ( "move" , $IWlogs , $createDir ) ; system( @args ) == 0 or die "error moving $IWlogs reason $!($^E)"; # NOTE: $! & $^E