I had assistance from PHV, in completing most of the script below. It was not part of the original request to delete said folders after removing files. I have tried numerous configurations like what is highlighted below, does anyone know the correct placement and/or code to complete said task...
Current script is as follows, it will delete a folder if it is "already" empty but will not remove files then delete the folder. Do I just have it in the wrong location? This was not part of the original request, would it be better if I create a new topic?
thanks again
Set fso =...
Thank you for the fast responses and sorry for my late response.
The script is almost complete. 1 issue discovered is files that reside in the test1 & test2 folder are being deleted. 2nd issue found is deleting the folders once they are empty.
Set fso =...
This code is searching the correct directories test1 and test2, the only remaining issue that I currently see is it is also finding the folders that do not start with "20". Is this possible? Thank you for taking the time to work on this.
Set fso = CreateObject("scripting.filesystemobject")...
My thought process was search for 2 characters from left to right for the folder name that starts with 20, since the subfolders where I want to delete subfolders all start with 20 (20010322, 20030322, 20110322). Directory structure if it helps is
z:\test1\20010322\data\files and...
const fldname = "Z:\"" points to the Main directory where test1/test2 reside.
I have tried are;
If Left(folder.Name, 2) = "20" Or left(folder.parentfolder.name, 2) ="20" Then
But I am not sure if I just put it in the wrong location of the script or if the logic is off or what have you
There are files that go back many years. The files are under a drive with 2 "Main" sub directories (test1 and test2). The test1 and test2 folders have thousands of subfolders with a named date format IE 20010329. Said example subfolder has numerous files and subfolders. I am attempting to...
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.