Wendy, I like this idea. I suck at batch files but years ago I liked playing with Visual Basic Scripting (.vbs files) so I tried it. Seems to work. Here is what I suggest you try as an experiment. Copy and paste this code into Notepad.Create a "Job" in Windows-Task-Manager.
Have it run a "Batch-File" on a Schedule.
I can't tell You how to create that Batch-File off hand,
but I'm reasonably sure that it can be made to select
Files based on Creation Date / Time, and/or, only in a particular Folder,
and/or, with a particular File-Type-Extension.
Do a search for "Windows Batch-File options", and, "Windows Schedule a Task"
.
.
.
' Delete All Files in a Folder
set objFSO = createobject("Scripting.FileSystemObject")
set objFolder = objFSO.GetFolder("C:\Junk")
for each folder in objFolder.SubFolders
objFSO.DeleteFolder folder.path, True
next
for each file in objFolder.Files
objFSO.DeleteFile file.path, True
next


Are there specific directories and file extensions that you want to delete? Do you have PERL installed on your computer?I need to delete some files automatically when they age to 3 days old.
C:\utils\XPutils\utils>perl cleantmp.pl -h
Clean files in . older than 1 days, matching .tmp.
Usage: cleantmp [-d] [-day] [-h] [-l] [-v]
-d Enable debug mode.
-day Specify TMP file age in days, default = 1.
-h Display this text and exit.
-l List files that would be deleted, without deleting.
-v Enable verbose output.
The other suggestions here are good I think BUT be careful, jobs or services that delete data are not to be taken lightly, any kind of slip up and you could lose valuable data.Windows 10 tiny computer, This computer does not have much hard drive. Fills up with videos very fast. I need to delete some files automatically when they age to 3 days old. An old dog trying to learn new tricks.
Help?
ForFiles /p "C:\Temp" /s /d -3 /c "cmd /c del @file"
Yep, when run the batch file runs once. I have been using it and it works fine on my Windows 10 system. Every day I have been adding 3 files to my folder C:\Temp and every day the batch file removes anything 3 days old (or older if I forget to run it for a day or two).I'm sorry I haven't responded Sooner, I need something that will run at midnight every day.
As I understand this bat file will only run once when run?
ForFiles /p "C:\Temp" /s /d -3 /c "cmd /c del @file"
When you put it that way it doesn't sound quite as scandalous.In my case it is a porch camera on a tiny computer with a small HD taking videos.
See thisIn my case it is a porch camera on a tiny computer with a small HD taking videos.
Here's the MS docs for this:The file path is C:/users/wendy/documents/videos
How do I merge the two?
Yours would look like this:The file path is C:/users/wendy/documents/videos
How do I merge the two?
ForFiles /p " C:/users/wendy/documents/videos " /s /d -3 /c "cmd /c del @file"