microsoft.public.scripting.vbscript - Microsoft Office Project
The script is GREAT!! Just what I need. Thanks!! "Pegasus (MVP)" wrote: > > "Chris" < XXXX@XXXXX.COM > wrote in message > news: XXXX@XXXXX.COM ... > > looking for a script or something will let me schedule it. Only plan to > > do > > it once a year so might have lots of log files. Each log is less than 2 > > MB. > > > > Thanks. > > Here you go. Make sure to run the script with active=false until you're > satisfied that it deletes the right files! > > Const Active = False > Const sSource = "d:\My Files" > Const MaxAge = 10 'days > Const Recursive = True > > Checked = 0 > Deleted = 0 > > Set oFSO = CreateObject("Scripting.FileSystemObject") > if active then verb = "Deleting """ Else verb = "Old file: """ > CheckFolder oFSO.GetFolder(sSource) > > WScript.echo > if Active then verb = " file(s) deleted" Else verb = " file(s) would be deleted" > WScript.Echo Checked & " file(s) checked, " & Deleted & verb > > Sub CheckFolder (oFldr) > For Each oFile In oFldr.Files > Checked = Checked + 1 > If DateDiff("D", oFile.DateLastModified, Now()) > MaxAge Then > Deleted = Deleted + 1 > WScript.Echo verb & oFile.Path & """" > If Active Then oFile.Delete > End If > Next > > if not Recursive then Exit Sub > For Each oSubfolder In oFldr.Subfolders > CheckFolder(oSubfolder) > Next > End Sub > > >
Hi, I need your help. There is a folder, it contains some subfolders and files. I need to delete the files created 2days ago in this folder , I also need to delete the files in the subfolders, but I do not need to delete the subfolder. I have looked for the scripts in internet for a long time, but no result was found.
Hi I am looking for a way to set the attirbutes of a folder and all of its subfolders (including all files) from any to Archive help is greatly apreciated Regards, Martin
Dear All, i'm new in vb scripting and a task was assigned to me so as to creat a vb script that performs the following: if i have a folder whose path is: "D:\Test" and it containes more than one sub folder as: "D:\Test\Sub1", "D:\Test\Sub2", etc.. the sub folders containes different types of files what i want to do is to copy only all text files in all the sub folders under "D:\Test", to a new folder "D:\Text" without copying any of the sub folders. could any one help? thanks in advance