Jump to content

Cycling through zip files in a folder


Recommended Posts

What I'm trying to accomplish is a script that will verify that my zip backs up have completed correctly. My issue is I would like for it to check several different zip's in a single location. Is it possible to use a wildcard in some sort of do, until loop?

Here is my code thus far:

;http://www.autoitscript.com/forum/index.php?showtopic=19030&hl=Julian

#include <Date1.au3>
$currentdate = _NowCalcDate()
$Today = _DateToDayValue(@YEAR, @MON, @MDAY)
$Yesterday = _DateToDayValue(@YEAR, @MON, @MDAY) - 1
$filedate = _NowCalcDate()
$UserFile = FileOpen("z:\Logs\ZipBackUps-" & $filedate & "", 1)


$Centmszipmod = FileGetTime("T:\sis\com\com5_AR0.ZIP")
If not @error Then
    $hourminute = $Centmszipmod[3] & "" & $Centmszipmod[4]
    $moddate = $Centmszipmod[0] & "" & $Centmszipmod[1] & "" & $Centmszipmod[2]
    $filejulian = _DateToDayValue ($Centmszipmod[0], $Centmszipmod[1], $Centmszipmod[2])
EndIf

If $hourminute > 330 And  $hourminute < 400 And $filejulian = $today Then
    MsgBox(0,"T:\sis\com\com5_AR0.ZIP Successful","T:\sis\com\com5_AR0.ZIP Successful")
    FileWriteLine($UserFile, "Zip backup for T:\sis\com\com5_AR0.ZIP successful.")
Else
    MsgBox(0, "T:\sis\com\com5_AR0.ZIP Failed","T:\sis\com\com5_AR0.ZIP Failed")
EndIf

FileClose($UserFile)

Where it says "$Centmszipmod = FileGetTime("T:\sis\com\com5_AR0.ZIP")" I would like to some how use a wild card variable to repeat this same methodology with all *.zip's.

Obviously I would like to use the same variables for the the filewriteline and msgboxes.

Any ideas?

-mjg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...