hello,
the below script runs and doesn't output any errors but its doesn't delete the files. just wondering if anyone could help with this please
dim fso, fldr, x
set fso = createobject("scripting.filesystemobject")
set fldr = fso.getfolder("C:\FTPdata")
for each x in fldr.files
if datediff("d", x.datelastmodified, now()) > 15 and _
right(x.path, 4) = ".DAT" then
fso.deletefile x.path
End if
Next
set fso = createobject("scripting.filesystemobject")
set fldr = fso.getfolder("C:\mobileiron")
for each x in fldr.files
if datediff("d", x.datelastmodified, now()) > 2 and _
right(x.path, 4) = ".tgz" then
fso.deletefile x.path
End if
Next
set fso = createobject("scripting.filesystemobject")
set fldr = fso.getfolder("C:\block\PRIME")
for each x in fldr.files
if datediff("d", x.datelastmodified, now()) > 2 and _
right(x.path, 4) = ".gpg" then
fso.deletefile x.path
End if
Next
set fso = createobject("scripting.filesystemobject")
set fldr = fso.getfolder("C:\block\ISE")
for each x in fldr.files
if datediff("d", x.datelastmodified, now()) > 2 and _
right(x.path, 4) = ".gpg" then
fso.deletefile x.path
End if
Next
the below script runs and doesn't output any errors but its doesn't delete the files. just wondering if anyone could help with this please
dim fso, fldr, x
set fso = createobject("scripting.filesystemobject")
set fldr = fso.getfolder("C:\FTPdata")
for each x in fldr.files
if datediff("d", x.datelastmodified, now()) > 15 and _
right(x.path, 4) = ".DAT" then
fso.deletefile x.path
End if
Next
set fso = createobject("scripting.filesystemobject")
set fldr = fso.getfolder("C:\mobileiron")
for each x in fldr.files
if datediff("d", x.datelastmodified, now()) > 2 and _
right(x.path, 4) = ".tgz" then
fso.deletefile x.path
End if
Next
set fso = createobject("scripting.filesystemobject")
set fldr = fso.getfolder("C:\block\PRIME")
for each x in fldr.files
if datediff("d", x.datelastmodified, now()) > 2 and _
right(x.path, 4) = ".gpg" then
fso.deletefile x.path
End if
Next
set fso = createobject("scripting.filesystemobject")
set fldr = fso.getfolder("C:\block\ISE")
for each x in fldr.files
if datediff("d", x.datelastmodified, now()) > 2 and _
right(x.path, 4) = ".gpg" then
fso.deletefile x.path
End if
Next