|
-
Jun 15th, 2006, 11:23 AM
#1
Thread Starter
New Member
deleating .bak files from subfolders
Whats up everyone,
Im having a bit of trouble getting this script to delete the .bak files in all subfolders. Im new to .vbs so please be gental. Here is what I have so far, it does delete the .bak files in that directory, but ive tried all kinds of things to make it delete in the subfolders too.
On Error Resume Next
const Archive = "\\Bubba\Archive\Archive Holdings"
Const DeleteReadOnly = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(Archive)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path
Do Until i = 1
strFiles = strPath & "\*.bak"
objFSO.DeleteFile(strFiles), DeleteReadOnly
strFiles = strPath & "\...\*.bak" <------line im having trouble with*****
objFSO.DeleteFile(strFiles), DeleteReadOnly
Wscript.Sleep 6000000
Loop
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|