dim dt, fso, odir, f
dt=now
set fso=createobject("scripting.filesystemobject")
if fso.folderexists(sdir) then
set odir=fso.getfolder(sdir)
for each f in odir.files
'"n" for minutes, "h" for hours etc
if (strcomp(fso.getextensionname(f.name),"trc",1)=0) and (datediff("n",f.datelastmodified,dt)>60) then
f.delete true 'forced
end if
next
set odir=nothing
else
wscript.echo "directory: " & sdir & " not found." & vbcrlf & "operation aborted."
end if
set fso=nothing
[/tt]
Thanks tsuji for the reply..
I have try this,
I schedule task the script using batchfile,
but the files still remains...
the trace files are with the name- "audittrace20100430123638_6552.trc"
can you please help me out becoz the files will created and the disk space is becoming low.
can u give example for deleting the doc files using the VB script..
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.