copy search results using command line

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

copy search results using command line

Post by ChrisGreaves »

Win10/Everything 1.5.0.1315a(x64)
I am stumbling in my first effort to use the command-line access to Everything.
I read through the topic copy search results using command line and ran the following DOS command with the results shown:-
Untitled.png
Untitled.png (9.45 KiB) Viewed 1535 times
I suppose that my file mask *.pdf is augmented by the folder taken from the command line; since my CMD prompt is in T:\, Everything assumes that I want to search in the root folder T:\, whereas I want to search all my drives.

Background: I write in MSWord2003/VBA, and deal with DOCuments with {IncludePicture} fields. Sometimes the target image goes missing (always MY fault), and I will automate a process to search DOCuments, and locate each {IncludePicture} field that is asking for a non-existent file.
At this point I thought to construct and execute a simple BATch file command and obtain a short list of locations where the file can be found, and then (VBA) be copied into the appropriate folder.
Untitled2.png
Untitled2.png (12.14 KiB) Viewed 1535 times
With the results shown above, my VBA will decide which image to use and then COPY it across.

I feel sure that my little knowledge of Command-line use of Everything is throwing up a small hurdle. I have not made use of Everything command line running until today.

Thanks for any tips.
Chris
horst.epp
Posts: 1448
Joined: Fri Apr 04, 2014 3:24 pm

Re: copy search results using command line

Post by horst.epp »

Look in the help for the command line switches.
For your case using the Everything command line tool es.exe is the better way.

With Everything itself I use the following line in a file manager
Everything.exe -s nopath:exact:#quote:#[basename:"%S1"#]:
%S1 is the file to be searched.
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: copy search results using command line

Post by ChrisGreaves »

horst.epp wrote: Tue Nov 22, 2022 1:51 pm For your case using the Everything command line tool es.exe is the better way.
Thanks Horst.
I did not have ES.exe on my system, and have now downloaded (and unzipped it).
This topic from 2016 describes my new problem, so I will pursue that.
I have another option which is to use my own file-finding routine I wrote in VBA twenty years ago.
Cheers, Chris
void
Developer
Posts: 16773
Joined: Fri Oct 16, 2009 11:31 pm

Re: copy search results using command line

Post by void »

If you are using ES with the Everything 1.5 alpha, please try the following search:

es.exe -instance "1.5a" *.pdf | clip.exe



-or-

Disable the 1.5a instance if you are not using Everything 1.4:
  • In Everything, from the File menu, click Exit.
  • From the Start menu, search for: notepad
  • Right click Notepad and click Run as administrator.
  • In Notepad, from the File menu, click Open.
  • Select your Everything-1.5a.ini in the same location as your Everything.exe and click Open.
  • Change the following line:
    /alpha_instance=1
  • to:
    /alpha_instance=0
  • Restart Everything.
now you can use the following search with ES:

es.exe *.pdf | clip.exe



ES
Everything GUI command line options
Post Reply