Sorry to keep this going but I had one more question. What if I needed to go through multiple subfolders? The script I have seems to only look at subfolders that are in the root but will not look at subfolders inside those subfolders. Let me know if that makes sense.
Actually I did have one more question. Will datelastmodified be able to compare itself to the format of the strDate? Meaning do I need to change the format of the hard coded date?
I had tried the Now function but I was getting errors so I just scrapped that idea.
Also, I had appended the time stamp to the end of the date stamp but decided to create a new variable.
Thanks for the input and the script works great.
Thank you for the reply.
I was able to incorporate what you said into my existing script. Will I be able to add a time stamp in there as well?
Here is the working script.
Dim strExtensions
Dim strExt
Dim strDate
strPath = "C:\Test\"
strDest = "C:\TestCopies\"
strExtensions = "txt"
strDate...
Hello all,
I am trying to append a date stamp to a file name that I am copying to another folder. Here is the script I have so far.
Dim strExtensions
Dim strExt
Dim strDate
strPath = "C:\Test\"
strDest = "C:\TestCopies\"
strExtensions = "txt"
strDate = "9/7/2010 6:00:00 PM"
Set objFSO =...
I got this to work with the following code. I added the echo and figured out that it was enumerating negatively. This seems to have fixed it.
Dim fso, startFolder
Set fso = CreateObject("Scripting.FileSystemObject")
startFolder = "C:\Test\"
DeleteOldFiles startFolder
Function...
Hello all,
I am using the below script to delete files based on creation date but I can not get it to work. For example, I want to delete a file that is 30 minutes old. I eventually want it for 24 hours but I am trying to test it by using a smaller interval. Here is the script:
Dim fso...
Hey all,
I have searched and searched for this but have not found it anywhere. Has anyone seen a Visio rack stencil/template that has the unit numbers on it. I am looking for a 42U rack template that has the numbers listed on each slot from 42 to 1. I have seen one on Tech Republic but I...
I have added the code to the script but I do not think it is looking at the folder. It basically does the same thing it did before the extra code was added in. But of course I could have done something wrong. Here is the code:
NumberOfDaysOld = 30
NumberOfDaysOldTemp = 90
strPath =...
Thank you for responding seg284. There is a common property with these folders. They all begin with the word Fax in the folder name. I was trying the wildcard "Fax*" but of course this did not work. I have tried adding a Case statement to the script but it did not work the way I wanted it...
Hey all,
First off, I am not a programmer but I need to create a script to delete files on one of our servers. I have a working script that will delete all files in a specific folder and all of it's subfolders after 30 days. I need to add some sort of a wildcard or exclusion for a few...
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.