command line with program name in quotes - buggy?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

command line with program name in quotes - buggy?

Post by ChrisGreaves »

Untitled2.png
Untitled2.png (41.68 KiB) Viewed 2359 times
I have restarted playing with Command-line options.
The path to my Everything.exe file contains a space, so in the command window I have enclosed that file identifier in double-quotes.

I want Everything to locate all INI files on my system (C: and T:)
The Search Box suggests that something went awry with my creation of the command-line string, or perhaps with the parsing of that string.
I may be completely way off track with this specific objective, but my goal in my self-imposed Command-line Options work is to build a batch file that can automate a task which, to date, I have been doing manually.

After reading this topic I tried doubling the double quotes around my *.INI but this merely reproduced my result shown above.

Thanks for any help
Chris
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: command line with program name in quotes - buggy?

Post by ChrisGreaves »

So I went on exploring Command Line Options and finally reached the -s parameter.
"C:\Program Files\Everything 1.5a\Everything64.exe" -s *.ini
is what I should have been using. :roll:
CommandLine_10.png
CommandLine_10.png (70.38 KiB) Viewed 2353 times
I remain puzzled, though, about the manipulation of the double-quotes in my earlier screenshot.

My use of the -filename parameter with a generic mask to follow must have confused the heck out of Everything.exe; but it did not raise any error message that I could see.
Cheers, Chris
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: command line with program name in quotes - buggy?

Post by therube »

Oh, not quite sure, but I think this is going to depend on the definition of "filename".

Where you or I see, ah "filename", & "oh, I want to find a file named, '123'", but that is not what a "filename" is (I'm thinking).

Seems that filename is a "full file name, so path+name kind of thing.

So "123" is the name part only, & with nothing else given, Everything what, takes the current directory & searches for the name within the (as it is) current directory.

If you gave it a "filename" instead, so "c:/out/testing/123", it would look for the name "123" - in the c:/out/testing directory.


(At least that's the way it's looking to me.)
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: command line with program name in quotes - buggy?

Post by ChrisGreaves »

therube wrote: Wed May 31, 2023 3:41 pmIf you gave it a "filename" instead, so "c:/out/testing/123", it would look for the name "123" - in the c:/out/testing directory.
He heh!
Try offering the command line an non-existent file. Do you get an error warning of any sort? :twisted:
Try offering the command line an existing but unsuitable file. Do you get an error warning of any sort? :twisted: :twisted:

Cheers, Chris
void
Developer
Posts: 16767
Joined: Fri Oct 16, 2009 11:31 pm

Re: command line with program name in quotes - buggy?

Post by void »

-filename will set your search to the absolute filename from the specified filename.

The current working directory is used if a full path is not specified.
The file or folder specified by the filename does not have to exist.



Please use -s to set the search.
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: command line with program name in quotes - buggy?

Post by ChrisGreaves »

void wrote: Thu Jun 01, 2023 3:58 am -filename will set your search to the absolute filename from the specified filename.
Untitled.png
Untitled.png (31.64 KiB) Viewed 2297 times
OK. I am confused.
At first I thought that -filename instigated a search for files matching the given template.
Then I learned that the -s parameter should be used for that (what I think of as a regular search)
Then I thought that perhaps -filename, with a file name supplied, was some sort of indirect-search, so I loaded a text file WhatFAQ.doc.TXT with the string "WhatFAQ.DOC"; that found nothing, so that theory was shot!

Now I am at the stage where I can get -filename WhatFAQ.doc to locate one copy of a file providing that I am in that file's folder, (screenshot attached) but that seems to me to be a particularly weak use of a parameter.

I suspect I am missing something powerful here, but cannot work out what it is!
I read through a few topics and this post by Void read "... Everything.exe -filename <path to folder> ..." so now I have a suspicion that the -filename parameter is really most useful in a batch file and does something like setting a base for further searching, especially with command that follow on from that command which contains the -filename command?
Which may be the source of my confusion, as I still think of "filename" as meaning the name of a file, rather than as a Path.
Thanks for any straightening out.

I'd especially be pleased to determine the post that triggered the development of the -filename parameter.
Chris
void
Developer
Posts: 16767
Joined: Fri Oct 16, 2009 11:31 pm

Re: command line with program name in quotes - buggy?

Post by void »

Ideally, the specified filename should exist.

Example usage:

Code: Select all

"c:\program files\Everything 1.5a\Everything64.exe" -filename c:\windows\notepad.exe
(opens Everything and sets the search to: C:\windows\notepad.exe )



The current working directory is used if you don't specify an absolute path.

For example:

Code: Select all

cd c:\windows
"c:\program files\Everything 1.5a\Everything64.exe" -filename notepad.exe
(opens Everything and sets the search to: C:\windows\notepad.exe )



This might be useful when combined with the TAB key:

From a command prompt, type in:

Code: Select all

"c:\program files\Everything 1.5a\Everything64.exe" -filename 
Press TAB, and keep pressing TAB to cycle through filenames in the current directory.



-filename is similar to -search
However, -filename will also do the following:
  • Convert the specified path to an absolute path. (relative to the current working directory)
  • Resolves some ::{} shell folders.
  • Adds a trailing path separator if the specified filename points to a folder.
  • Resolves shell: paths.
  • Resolves environment strings.
  • Converts short paths to long paths.


More examples of -filename that you can't do with -search:

Code: Select all

"c:\program files\Everything 1.5a\Everything64.exe" -filename ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
"c:\program files\Everything 1.5a\Everything64.exe" -filename shell:startup
"c:\program files\Everything 1.5a\Everything64.exe" -filename %APPDATA%
"c:\program files\Everything 1.5a\Everything64.exe" -filename C:\Progra~1
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: command line with program name in quotes - buggy?

Post by therube »

Press TAB, and keep pressing TAB to cycle through filenames in the current directory.
Play that again if you will? I'm not seeing any cycling action?
(Just jumps from first result to searchbar & back.)
"c:\program files\Everything 1.5a\Everything64.exe" -filename
-filename looks to require a (following) parameter?
So -filename . or -filename "" or -filename anything, but not (seemingly) -filename [itself].
void
Developer
Posts: 16767
Joined: Fri Oct 16, 2009 11:31 pm

Re: command line with program name in quotes - buggy?

Post by void »



While still in the command prompt, with the cursor after
-filename
, press TAB.

Pressing TAB in a command prompt will cycle through the filenames in the current directory.
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: command line with program name in quotes - buggy?

Post by ChrisGreaves »

void wrote: Thu Jun 08, 2023 10:10 pmWhile still in the command prompt, with the cursor after
-filename
, press TAB.
Pressing TAB in a command prompt will cycle through the filenames in the current directory.
Got It!
Untitled.png
Untitled.png (27.85 KiB) Viewed 2249 times
1. Don't type a hyphen after filename; that hyphen is the Underscore Cursor, and marks where the blinkin' cursor is when I tap the tab key
2. DO type the -filename string
3. Then (for this folder) "Appdata" springs into view.

4. Bonus: Shift-Tab goes backward (Windows motto: You can always Shift into reverse gear"!) {{{ if you remember to tap a space after -filename, it reverses from the GetGo! }}}
Thanks, Chris
Post Reply