Select files based on time, etc.

General discussion related to "Everything".
Post Reply
NotNull
Posts: 2681
Joined: Wed May 24, 2017 9:22 pm

Select files based on time, etc.

Post by NotNull » Tue Feb 09, 2021 4:24 pm

Everything - and Windows itself too - store date/time information in a special format: the number of 100-nanoseconds ticks since 01 January 1601 @ 00:00:00. For example: it is now 132573612897180232 o' clock.

While this makes it easy to get a date/time range, it is difficult to get all files modified in October of any year. Or between 09:00 and 17:00.


One way to work around this limitation is to load Everything data in Excel and manipulate it from there, as described here
This is another way to accomplish that.

The basic idea is to (1) search for files in Everything, (2) export the results as a filelist (.EFU file), (3) load that file in a separate utility, (4) filter by time/month/ whatever and (5) load the filtered data back in Everything.
Probably sounds complicated, but is quite easy (my opinion, of course) :

As an example: I want all .exe files in the Windows folder that were last modified:
- Before 2020
- In December
- In a weekend (Saturday or Sunday)
- Between 23:00 and 07:00

So I:
  1. Search for c:\windows\ ext:exe dm:<2020
  2. Export the results as a .EFU file
  3. In File Explorer, drag and drop that file on Drop your EFU file here.cmd
  4. In the new window that opens, click the Add criteria
  5. Fill in the fields, so I end up with this:
    2021-02-08 12_08_58-Select.png
    2021-02-08 12_08_58-Select.png (127.88 KiB) Viewed 1327 times
  6. Important: Select all files (CTRL+A)
  7. Press the OK button
  8. And now a new Everything window will open with the files that match the previously mentioned time criteria
  9. That's all

How to install:
Extract the 2 files in the attachd Zip-file to a folder.
That's it.

Notes:
  • Will detect where your Everything.exe is, based on where the Everything service is running from.
    Don't use this if you are running Everything as administrator[/] or if you run Everything with the -instance command-line option.
    If you are running an Everything instance and want to use this, please let me know adn I will add support for that. Will not add support for running as administrator.
  • Requires Windows10, because of the recent PowerShell functionality.
Attachments
EverythingTimeRange_1.1.zip
(1.03 KiB) Downloaded 21 times

rickpeterson
Posts: 7
Joined: Fri Feb 05, 2021 7:18 pm

Re: Select files based on time, etc.

Post by rickpeterson » Tue Feb 09, 2021 5:52 pm

Thanks - trying this now. Do I need excel or anything installed? I am using a VM with basic windows 10, 16gb ram a few vpus.

NotNull
Posts: 2681
Joined: Wed May 24, 2017 9:22 pm

Re: Select files based on time, etc.

Post by NotNull » Tue Feb 09, 2021 6:07 pm

No Excel needed, just Win10

NotNull
Posts: 2681
Joined: Wed May 24, 2017 9:22 pm

Re: Select files based on time, etc.

Post by NotNull » Tue Feb 09, 2021 7:42 pm

A basic screen capture to get the idea. Click to open...

Image
(will be available for the next 2 weeks)

rickpeterson
Posts: 7
Joined: Fri Feb 05, 2021 7:18 pm

Re: Select files based on time, etc.

Post by rickpeterson » Wed Feb 10, 2021 3:00 pm

Thanks - I get through it all but when I select all or select 10 files and click OK - nothing happens - the powershell script goes away but Everything doesnt open anything.

Everything is set to run as a service and is installed/running.

The difference being my export files are fairly large (8megs) probably 90,000 files or so.

When clicking OK nothing happens though.

horst.epp
Posts: 349
Joined: Fri Apr 04, 2014 3:24 pm

Re: Select files based on time, etc.

Post by horst.epp » Wed Feb 10, 2021 5:36 pm

rickpeterson wrote:
Wed Feb 10, 2021 3:00 pm
Thanks - I get through it all but when I select all or select 10 files and click OK - nothing happens - the powershell script goes away but Everything doesnt open anything.

Everything is set to run as a service and is installed/running.

The difference being my export files are fairly large (8megs) probably 90,000 files or so.

When clicking OK nothing happens though.
I had this on my first try and found that I made an error with the file format on the export as .efu
Next time I did it right and it works.

NotNull
Posts: 2681
Joined: Wed May 24, 2017 9:22 pm

Re: Select files based on time, etc.

Post by NotNull » Wed Feb 10, 2021 7:00 pm

So, does Everything open after you selected files and pressed OK?

There might be a limit to the amount of files that Everything can open this way.
Try to limit your initial number of files that you select in Everything and export to the EFU file, for example by adding dm:2021-01 to your query. That will select all your files that were modified in January this year.

Can you complete all steps with this limited amount of files?


I will look into this a little more. Didn't test it with thàt many files ...

horst.epp wrote:
Wed Feb 10, 2021 5:36 pm
I had this on my first try and found that I made an error with the file format on the export as .efu
Next time I did it right and it works.
Thanks for testing, @Horst! Any comments?
(beside the obvious "Use Total Commander for this" ;) (as would I, btw ..))

rickpeterson
Posts: 7
Joined: Fri Feb 05, 2021 7:18 pm

Re: Select files based on time, etc.

Post by rickpeterson » Wed Feb 10, 2021 7:59 pm

Hi,

So I am testing it with this:

j:\BI\*.avi dm:2019-03

It gives me 220 objects. I export as file, export, somename - file type is *.efu

It brings up the powershell. I use hour between 1 & 7 - gives me 4 files, i select all, press OK and then nothing happens.

I am using C:\Develop\EverythingTimeFilter as the test folder (per the gif)

Any ideas on what I am missing?

Thanks,
Rick

rickpeterson
Posts: 7
Joined: Fri Feb 05, 2021 7:18 pm

Re: Select files based on time, etc.

Post by rickpeterson » Wed Feb 10, 2021 8:17 pm

Everything running as service. C:\Program Files\Everything

registry looks good. I think I am almost there but Everything doesnt open when highlighted items are selected and OK is pressed.

NotNull
Posts: 2681
Joined: Wed May 24, 2017 9:22 pm

Re: Select files based on time, etc.

Post by NotNull » Wed Feb 10, 2021 8:28 pm

OK, those ae useful details. Thanks!

The code will try to detect where Everything is installed by looking in the registry for the location where the Everything Service is installed.

Please check if Everything is configured correctly:
- Go to Menu:Tools > Options > General
- Make sure Everything Service is enabled (you should see a check-mark; not a little black square)
- Make sure Run as administrator is unchecked.
- Restart Everything if you made any changes.


If that was configured correctly, we need to look a little deeper:
- start the Command Prompt (CMD.exe)
- Paste the following command and press ENTER:

Code: Select all

@for /f "usebackq" %x in (`reg query HKLM\SYSTEM\CurrentControlSet\Services^| findstr /i "Everything"`) Do @reg.exe query %x
- Post the output of that command here.

NotNull
Posts: 2681
Joined: Wed May 24, 2017 9:22 pm

Re: Select files based on time, etc.

Post by NotNull » Wed Feb 10, 2021 8:35 pm

Forget about the previous post: this is my mistake!

The "" around the path to Everything.exe (in your case "C:\Program Files\Everything\Everything.exe" ) were missing.

And that causes Everything not to be found. Will download it and make the necessary modifications. ..

(probably tomorrow as I am doing other stuff right now)

horst.epp
Posts: 349
Joined: Fri Apr 04, 2014 3:24 pm

Re: Select files based on time, etc.

Post by horst.epp » Wed Feb 10, 2021 8:36 pm

NotNull wrote:
Wed Feb 10, 2021 7:00 pm
So, does Everything open after you selected files and pressed OK?

There might be a limit to the amount of files that Everything can open this way.
Try to limit your initial number of files that you select in Everything and export to the EFU file, for example by adding dm:2021-01 to your query. That will select all your files that were modified in January this year.

Can you complete all steps with this limited amount of files?


I will look into this a little more. Didn't test it with thàt many files ...

horst.epp wrote:
Wed Feb 10, 2021 5:36 pm
I had this on my first try and found that I made an error with the file format on the export as .efu
Next time I did it right and it works.
Thanks for testing, @Horst! Any comments?
(beside the obvious "Use Total Commander for this" ;) (as would I, btw ..))
Not further comments ;)
My typical searches are much simpler and often I use a combination of TC searches with Everything commands.
Like "All modified files from today in current dir and all sub-dirs" for example.

horst.epp
Posts: 349
Joined: Fri Apr 04, 2014 3:24 pm

Re: Select files based on time, etc.

Post by horst.epp » Wed Feb 10, 2021 8:37 pm

NotNull wrote:
Wed Feb 10, 2021 8:35 pm
Forget about the previous post: this is my mistake!

The "" around the path to Everything.exe (in your case "C:\Program Files\Everything\Everything.exe" ) were missing.

And that causes Everything not to be found. Will download it and make the necessary modifications. ..

(probably tomorrow as I am doing other stuff right now)
I have portable Everything under c:\tools\everything.
That avoids a lot of problems :)

NotNull
Posts: 2681
Joined: Wed May 24, 2017 9:22 pm

Re: Select files based on time, etc.

Post by NotNull » Wed Feb 10, 2021 9:20 pm

Version 1.1 can be found in the first post. This should fix the spaces in the path issue (it does here).

NotNull
Posts: 2681
Joined: Wed May 24, 2017 9:22 pm

Re: Select files based on time, etc.

Post by NotNull » Wed Feb 10, 2021 9:22 pm

horst.epp wrote:
Wed Feb 10, 2021 8:37 pm
I have portable Everything under c:\tools\everything.
That avoids a lot of problems :)
Exact same path here! :)

rickpeterson
Posts: 7
Joined: Fri Feb 05, 2021 7:18 pm

Re: Select files based on time, etc.

Post by rickpeterson » Thu Feb 11, 2021 7:23 pm

Hi - that seems to have done the trick & while it takes some time, I did a search that produced 98,000 results & it opened Search everything as expected! Thanks - this is great!

If I wanted to do a search from:

10:30pm to 7:40am the next day is there a way to do that as one search for everyday?

NotNull
Posts: 2681
Joined: Wed May 24, 2017 9:22 pm

Re: Select files based on time, etc.

Post by NotNull » Thu Feb 11, 2021 7:59 pm

Glad it is working as intended!
Unfortunately, you cant specify a time range like 10:30pm to 7:40am in one go. You will need 3 passes for that:
- Hour = 23-6 (selects 23:00-06:59)
- Hour = 22 and Minute = 30-59
- Hour = 7 and Minute = 00-40

NotNull
Posts: 2681
Joined: Wed May 24, 2017 9:22 pm

Re: Select files based on time, etc.

Post by NotNull » Thu Feb 11, 2021 9:16 pm

On second thought ...

I could write you a new version that doesn't split times in hours and minutes, but will combine them.
Then you can search for:
TIME greater than or equal to 2230 OR TIME smaller than or equal to 0640

Let me know when interested.

Post Reply