Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Substraction

Status
Not open for further replies.

ariefk

Technical User
Mar 17, 2002
18
ID
I need to delete file that's older than 3 days, my first step is to substract the file's date. Somebody has suggestion on this ?. Anyway, here's my questionable lines. That's resulted unpredictable number at the end.

Dim fso, f, d, f_age, dulu, skr, hasil
f_age=0
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile("TECHNOTE.TXT")
dulu = Isdate(f.DateCreated)
skr = now()
WScript.Echo "Created: " & f.DateCreated
WScript.Echo "Now: " & skr
f_age = skr - f.DateCreated
WScript.Echo "Age : " & f_age
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top