VBScript - Ignore any source files with today's date
Posted on 2012-04-03
I'm not a VBScript expert and I just cant seem to get the right variable.
Below is a script that Ignores any source files not modified yesterday.
I am trying to tweak this so that Ignores any source files modified today.
So if I run the script on April 4th, 2012 it will ignore any file modified with a date of April 4th, 2012.
Any help would be great.
Description = "Ignores any source files not modified yesterday. Not used on Restore."
ScriptType = 2
Sub RunBeforeFileCompare(Filename, ByRef Skip)
' Ignore if this is a Restore
If SBRunning.Restore then
YesterdayDate = Date - 1
YesterdatStr = CStr(Year(YesterdayDate)) & CStr(Month(YesterdayDate)) & CStr(Day(YesterdayDate))
FileDate = SBRunning.GetFileDateTime(Filename, TRUE)
FileStr = CStr(Year(FileDate)) & CStr(Month(FileDate)) & CStr(Day(FileDate))
If FileStr = YesterdatStr then
Skip = FALSE
Skip = TRUE