Help with es.exe command to get file and dir count

Discussion related to "Everything" 1.5 Alpha.
Post Reply
err_24546
Posts: 40
Joined: Wed Oct 11, 2023 1:47 am

Help with es.exe command to get file and dir count

Post by err_24546 »

Greetings.
I would like to find the best way (if possible, in a single command) to obtain via es.exe, from a list of items (files and folders, omit the files), a text file with the following data:
- Filecount (non-recursive)
- Dircount (non-recursive)
- Total Filecount
- Total Dircount

Note that these items do not necessarily have the same parent.
Ideally, it should be possible to obtain all values by running es.exe only once.
The returned txt file would contain the full names of the folders and the required values.
Any help?
Regards.
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: Help with es.exe command to get file and dir count

Post by NotNull »

There are options. However you need to be more specific ....
err_24546 wrote: Fri May 17, 2024 9:04 pm a list of items (files and folders, omit the files)
What would that list look like?

Code: Select all

Windows
notepad.exe
or:

Code: Select all

C:\Windows
C:\Windows\notepad.exe

And what would the desired output look like EXACTLY?
err_24546
Posts: 40
Joined: Wed Oct 11, 2023 1:47 am

Re: Help with es.exe command to get file and dir count

Post by err_24546 »

Thanks for reply.
What would that list look like?
Is a list of fullpaths, like this:

Code: Select all

C:\Windows
C:\Windows\notepad.exe
what would the desired output look like EXACTLY
i would like to look like this:

Code: Select all

;Fullpath	filecount	dircount	filecounttotal	dircounttotal
C:\Windows	1000	1000	2500	2500
C:\Windows\notepad.exe	0	0	0	0
Omit the headings, and the files if possible.
void
Developer
Posts: 17153
Joined: Fri Oct 16, 2009 11:31 pm

Re: Help with es.exe command to get file and dir count

Post by void »

You would have to write a script to accomplish this..

You can call ES to get the filecount, dircount, filecounttotal and dircounttotal:

filecount:

es.exe -get-result-count file:parent:c:\windows


dircount:

es.exe -get-result-count folder:parent:c:\windows


filecounttotal:

es.exe -get-result-count file:ancestor:c:\windows


dircounttotal:

es.exe -get-result-count folder:ancestor:c:\windows


The above will only work for folders, so you would need to check if the filename is a file or folder before calling es..
err_24546
Posts: 40
Joined: Wed Oct 11, 2023 1:47 am

Re: Help with es.exe command to get file and dir count

Post by err_24546 »

I see, and that would mean running es.exe a lot of times (4 times for each folder).

Could you please consider to add a new command to Everything.exe (or es.exe), that allows exporting results along with column values? Among other to let you set a search?

For example, if I combine filelist: with columns: and a new argument (/export) to get the results in a text file.

I bet that would be extremely helpful for a lot of folks!
err_24546
Posts: 40
Joined: Wed Oct 11, 2023 1:47 am

Re: Help with es.exe command to get file and dir count

Post by err_24546 »

Hi again.
I wonder if this is now possible with the new SDK 3? I mean getting the requested data with a single query
void
Developer
Posts: 17153
Joined: Fri Oct 16, 2009 11:31 pm

Re: Help with es.exe command to get file and dir count

Post by void »

It's possible with the Everything SDK3.
But not with ES just yet.
I am currently updating ES to use the Everything SDK3.
Post Reply