Delete files outside timerange over multiple dates.

General discussion related to "Everything".
Post Reply
Toffatoget
Posts: 4
Joined: Mon Aug 05, 2024 8:14 am

Delete files outside timerange over multiple dates.

Post by Toffatoget »

Might be a hard "Subject" line to understand.
Also had a hard time finding the right search words if this already have been posted.

My case here i that i am screenshoting my screen every minut 24h a day.
It gets automaticly stored in folder based on the date.
Like :
2023_01_06
2023_01_07
2023_01_08
and so forth.

Now, after 2 years of doing this..... i just now realise i dont need to keep the screenshots outside working hours.
An answere could be. "Why did you screenshot 24/7 and not just working hour?" :D and yes! that would be smart, and i will do that from now on.
But that does not fix my two years of screenshots that i want to cleanup :lol:

Everything might not be the right tool for this. But it have helped me in so many other cases taht i tought it was worth a shot.

Here is something that works. for one date.
pathtofolder\2023_01_06\" !dm:2023-01-06T08:00..2023-01-06T17:00

So it will be really time consuming going trough all the days like this. Might there be a wildcard i can use in the folder path and in the date, to make it itterate trough them all?

Thank you.
dedupeit
Posts: 52
Joined: Thu Jul 28, 2022 9:52 pm

Re: Delete files outside timerange over multiple dates.

Post by dedupeit »

viewtopic.php?t=10176

You can use dm-hour to filter just by the hour value of the date modified field. Something like this (for early morning files): dm-hour:0-8
Toffatoget
Posts: 4
Joined: Mon Aug 05, 2024 8:14 am

Re: Delete files outside timerange over multiple dates.

Post by Toffatoget »

thank you, much appreciated.
And i totaly forgot about the "Search Functions" post. That gave me some new ideas aswell.

Well see how it goes :)
NotNull
Posts: 5588
Joined: Wed May 24, 2017 9:22 pm

Re: Delete files outside timerange over multiple dates.

Post by NotNull »

This requires lots of efforts in Everything 1.4 (not impossible though), but is pretty straightforward in Everything 1.5.
All below is based on version 1.5:


Another option would be using dm-time:

Code: Select all

!dm-time:08:00..17:00
!dm-time:8:00am..5:00pm
(! = NOT, so it will show all screenshots made outside of office hours

Also, don't forget about the weekend:

Code: Select all

dm-week-day:saturday;sunday
Will show all screenshots made in the weekend.


P.S. Instead of deleting all these screenshots right away, I recommend moving them outside the folder structure first, to a new folder on the same disk.
If all went as desired, then you can delete that new folder. That way you can revert your actions if needed.


Assuming your screenshots are in folder "X:\path to\screenshots" and your screenshots are in the .png format:
- Create a new folder "X:\Out of Office" (name doesn't really matter)
- Search for
ext:png "X:\path to\screenshots\" dm-week-day:saturday;sunday

- Select all .png files ('CTRL + A')
- Menu => Edit => Advanced => Advanced Move to Folder
- Old format =
X:\path to\screenshots\%1

- New format =
X:\Out of Office\%1

- Check the preview of the results
- If all OK, press the OK buttons

(repeat these steps for the non-office hours query)
NotNull
Posts: 5588
Joined: Wed May 24, 2017 9:22 pm

Re: Delete files outside timerange over multiple dates.

Post by NotNull »

BTW: Keep an eye out for Windows' Recall feature. Might suit your needs.

BTW2:
Toffatoget wrote: Mon Jan 27, 2025 8:00 am screenshoting my screen every minut 24h a day.
[...]
after 2 years of doing this.
... you end up with over a million screenshots :shock:
(about a quarter of that amount when restricted to office hours)
Post Reply