del files & folders under specific folder

Lenovo Thinkcentre m58p tower core 2 duo...
July 19, 2010 at 03:12:03
Specs: Windows 7

Hi i am looking for a script that will scan multi directories and sub directories and serach for a folder name "temp" then it will delete all files and folders under this folder older the 12 days.

i succssed to create a vb script that delete the files but doesn't delete the folders

See More: del files & folders under specific folder

Report •

July 21, 2010 at 13:28:22
Hi tzachie

To display directories only try this, you could redirect this to fille
and use that to delete your directories.
The 12 days old is alot more difficult in Batch.
Display a dir *.* /a-d here and I might be able to help.

dir *. /s /b

Sorry I did,nt notice the VB script.

Report •

July 21, 2010 at 14:05:44
vbscript: if your script is deleting the files, it should be able to delete dirs the same way:

Delete Method
Deletes a specified file or folder.

object.Delete( force );

Required. Always the name of a File or Folder object.

Optional. Boolean value that is True if files or folders with the read-only attribute set are to be deleted; False (default) if they are not.
if you have trouble incorporating this method, you might want to post the vbscript code you're working with.

Report •
Related Solutions

Ask Question