#!d:\perl\bin use File::Copy; my $filename ='daily_count_by_userid_and_domain.xls'; my $path = '\\\\John\\c$\\daily\\'; my $nfile = '_daily_count_by_userid_and_domain.xls'; my $test = 'outputfile.txt'; ($Second, $Minute, $Hour, $DayOfMonth, $Month, $Year, $WeekDay, $DayOfYear, $IsDST) = localtime(time); my $real = $Year + 1900; my ($d,$m) = (localtime)[3,4]; my $date = sprintf("%02d%02d",++$m,$d,); my $npath = '\\\\Bob\\scripts\\security\\public\\'; my $complete = '$path$filename'; opendir (HOLDING, 'C:\daily'); chdir 'C:\daily'; @asci = glob ('*.xls'); foreach $asci (@asci) { if ($asci =~ /$asci/) system ("del $asci"); } system("\"C:\\Program Files\\Microsoft Office\\Office\\MSACCESS.EXE\" d:\\imas_security\\imas_security.mdb /x auto_update"); open(OUT, ">>$test"); copy ("$path$filename", "$npath$real$date$nfile"); closedir(HOLDING); close (OUT);