| Author |
Topic:
Need a Windows based solution for a certain problem.
[Locked] |
NuEM
Posts: 1,007
Registered: 2004-3-2 09:08:11
|
Date Posted:
1/1/00 12:00am
Subject:
Need a Windows based solution for a certain problem.
|
I need a Windows tool or script that lets me delete all folders that haven't been touched in x time. Specifically: If there is at least one file in this folder or any of its sub-folders that is "younger" than x, the folder must not be deleted. But all folders that don't have a file "younger" than x inside them or any of their sub-folders should be deleted.
Problem here is that the file system doesn't seem to propagate "last modified" to the parent folder, so simply using "last modified" on the top level folders doesn't help me.
Any ideas?
-----signature-----
|
Ptilk
Title: Creepy old pirate
Posts: 2,359
Registered: 2002-2-13 14:52:58
|
Date Posted:
1/1/00 12:00am
Subject:
Need a Windows based solution for a certain problem.
|
|
Not sure if it is what you are looking for, but "forfiles" is still available in the Microcrap tech database and it could be set to delete (or archive) any files older than a certain date, or not accessed since a certain date on older windows machines.
Not sure if it works on Windows 7 machines (or whatever the latest version is these days)....but it works on Unix machines and on WinXP and Server 2003.
|
RHWarrior
Posts: 770
Registered: 2009-9-30 18:42:12
|
Date Posted:
1/1/00 12:00am
Subject:
Need a Windows based solution for a certain problem.
|
Are you trying to set up a script to prune old porn downloads?
Hmm?
-----signature-----
"Drink coffee - do stupids things faster with more energy! ...and I'm all out of beans..." -me
"  ou guys need to stop dick riding wow and compare everything to it. It never invented a godamn thing, just made it popular. " -tinkly
|
NuEM
Posts: 1,007
Registered: 2004-3-2 09:08:11
|
Date Posted:
1/1/00 12:00am
Subject:
Need a Windows based solution for a certain problem.
|
Ptilk posted:
Not sure if it is what you are looking for, but "forfiles" is still available in the Microcrap tech database and it could be set to delete (or archive) any files older than a certain date, or not accessed since a certain date on older windows machines.
Not sure if it works on Windows 7 machines (or whatever the latest version is these days)....but it works on Unix machines and on WinXP and Server 2003.
Thanks, but I have already played around with forfiles a bit and there is at least no trivial way to let it do what I want. The problem is that I don't want to look at individual files, but keep the folder integrity intact. Either remove the whole folder because all files in it and its subfolders are older than x, or don't remove the folder and any of its files at all. But forfiles only lets me run commands on individual files losing the structure in which they are stored.
RHWarrior posted:
Are you trying to set up a script to prune old porn downloads?
Hmm?

My old porn downloads are sacred!
-----signature-----
|
Ptilk
Title: Creepy old pirate
Posts: 2,359
Registered: 2002-2-13 14:52:58
|
Date Posted:
1/1/00 12:00am
Subject:
Need a Windows based solution for a certain problem.
|
|
Not a clue then. I bet google knows the answer, just have to know how to ask the question, that's always the tricky part. Good luck.
|
Taliesihne
Title: Wind on the Deep Waters
Posts: 1,117
Registered: 2004-2-19 04:47:59
|
Date Posted:
1/1/00 12:00am
Subject:
Need a Windows based solution for a certain problem.
|
I will preface this by saying that because I am a hammer, everything looks like a nail to me....
I would write a quick and dirty C# app to do this. .NET has a DirectoryInfo Class that includes a LastAccessTime Property. Setting up the code to loop through directories and delete based on this property is not difficult.
A few quick decisions on UI implementation and I could have this coded in a weekend (more like a day tbh.)
Ps - I believe Visual C# Express is all you would need to write the app.
-----signature-----
Jesus saves, Allah protects, and Cthulhu thinks you'd make a nice sandwich
First comes smiles, then lies. Last is gunfire. -Roland Deschain, of Gilead
|
Abaddon_Ambrosius
Title: Retired Theurgist TL
Posts: 1,674
Registered: 2001-12-21 09:51:39
|
Date Posted:
1/1/00 12:00am
Subject:
Need a Windows based solution for a certain problem.
|
You could hire some child labor in Malaysia to remote access your PC and maintain your files for just pennies a month...
-----signature-----
In the immortal words of Socrates - "I drank what?"
"God you guys suck at the internet - how can you fail to locate porn?!" - Eternal_Midnight
"Knowing means nothing." - Fat-badger
|
NuEM
Posts: 1,007
Registered: 2004-3-2 09:08:11
|
Date Posted:
1/1/00 12:00am
Subject:
Need a Windows based solution for a certain problem.
|
Taliesihne posted:
I will preface this by saying that because I am a hammer, everything looks like a nail to me....
I would write a quick and dirty C# app to do this. .NET has a DirectoryInfo Class that includes a LastAccessTime Property. Setting up the code to loop through directories and delete based on this property is not difficult.
A few quick decisions on UI implementation and I could have this coded in a weekend (more like a day tbh.)
Ps - I believe Visual C# Express is all you would need to write the app.
Thanks, but I'm sure someone already done this somewhere. If only I could find it.
-----signature-----
|
Crooq_Lionfang
Title: Master Zergling
Posts: 185
Registered: 2003-3-11 11:53:17
|
Date Posted:
1/1/00 12:00am
Subject:
Need a Windows based solution for a certain problem.
|
Syntax Error: unable to process "Windows" and "Solution" in same entry
-----signature-----
If you have one foot in tomorrow and one foot in yesterday all you're going to do is piss on today
|