PROBLEM:
I have a folder called 'Backup' which has subfolders that contain large SQL backup files '.BAK' files and unfortunately I haven't been able to get the SQL maintenance plan's cleanup task to successfully delete the large files so I've resorted to attempt to use a VB script to clean up these older .BAK files and although I have found a few sample VB scripts that delete files based on date...I have not been successful in running it to delete the files in the subfolders...it only deletes the files in the current folder.
GOAL:
I need to have the script run automatically every night and delete any .BAK file in each subfolder older than one day from the current date...only want to keep one .BAK file in each subfolder. I know that there must be a way to accomplish this via VB script. Any assistance would be greatly appreciated. I know that I should be able to create a Windows Task to run every night but I'm having problems with the script.
Any assistance would be greatly appreciated.
I have a folder called 'Backup' which has subfolders that contain large SQL backup files '.BAK' files and unfortunately I haven't been able to get the SQL maintenance plan's cleanup task to successfully delete the large files so I've resorted to attempt to use a VB script to clean up these older .BAK files and although I have found a few sample VB scripts that delete files based on date...I have not been successful in running it to delete the files in the subfolders...it only deletes the files in the current folder.
GOAL:
I need to have the script run automatically every night and delete any .BAK file in each subfolder older than one day from the current date...only want to keep one .BAK file in each subfolder. I know that there must be a way to accomplish this via VB script. Any assistance would be greatly appreciated. I know that I should be able to create a Windows Task to run every night but I'm having problems with the script.
Any assistance would be greatly appreciated.