File path length?

General discussion related to "Everything".
Post Reply
CrxtJ7tOs4Iq
Posts: 28
Joined: Wed Jan 14, 2015 2:19 pm

File path length?

Post by CrxtJ7tOs4Iq »

I see there is a way to search based on name length(len:<length>), is there a way to do this on full path instead of just file name?
I am basically wanting a tool to find where the paths are to long for ntfs.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: File path length?

Post by NotNull »

Nice idea!

Don't think that this is possible in Everything.
But if you combine the powers of Everything with those of Powershell, you have a workaround:
  • In Everything query what you want (for exampl, only Q:\data or exclude C:\Windows, ...)
  • Export these results as a txt file (example: AllFiles.txt
  • In Powershell, issue this command:

    Code: Select all

    gc .\AllFiles.txt | where -property length -gt 255 | Out-File .\TooLong.txt
    
In TooLong.txt are your long filenames (including path).


BTW: 255 isn't really too long. Ifyou address the fil in a Win32 way instead of the DOS-way:
\\?\C:\enormous\long\path\including\filename.txt can be addresseed this way.

PS: Not tested. Please report back if this works or not.
CrxtJ7tOs4Iq
Posts: 28
Joined: Wed Jan 14, 2015 2:19 pm

Re: File path length?

Post by CrxtJ7tOs4Iq »

Awesome.... i already used powershell and everything command line for another project. Good thinking... will test early next week.
Will try my best to report back but i forget these things sometimes.
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: File path length?

Post by therube »

Adjust len: as needed.

Code: Select all

path:len:>254
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: File path length?

Post by NotNull »

therube wrote:Adjust len: as needed.

Code: Select all

path:len:>254
Very nice!!


@CrxtJ7tOs4Iq:
Normally I do test such things before posting, but this time I was in a real hurry (after rereading: even more typo's than usual ..)
Of course you should go with @therube's solution, but if you need something similar for one of your projects: I've tested it and it works OK.
If you want output to file *and* screen (system looked dead for too long), use Tee -file .\TooLong.txt instead of Out-File .\TooLong.txt
You don't need the ES.exe command-line utility to export; that can be done in Everything itself through Menu:File > Export ..
CrxtJ7tOs4Iq
Posts: 28
Joined: Wed Jan 14, 2015 2:19 pm

Re: File path length?

Post by CrxtJ7tOs4Iq »

Awesome!

Thanks
CrxtJ7tOs4Iq
Posts: 28
Joined: Wed Jan 14, 2015 2:19 pm

Re: File path length?

Post by CrxtJ7tOs4Iq »

NotNull wrote: BTW: 255 isn't really too long. Ifyou address the fil in a Win32 way instead of the DOS-way:
\\?\C:\enormous\long\path\including\filename.txt can be addresseed this way.
Trying to use this example with anything Powershell. While it doesn't error. It doesn't seem to work.
Having a hard time finding additional information.

example get-acl '\\?\C:\enormous\long\path\including\filename.txt'
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: File path length?

Post by NotNull »

CrxtJ7tOs4Iq wrote:
NotNull wrote: BTW: 255 isn't really too long. Ifyou address the fil in a Win32 way instead of the DOS-way:
\\?\C:\enormous\long\path\including\filename.txt can be addresseed this way.
Trying to use this example with anything Powershell. While it doesn't error. It doesn't seem to work.
Having a hard time finding additional information.

example get-acl '\\?\C:\enormous\long\path\including\filename.txt'
I don't have enormous long paths, but this works for me:

Code: Select all

PS C:\temp> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.16299.248
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.248
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


PS C:\temp> get-acl '\\?\C:\Windows\System32\drivers\etc\hosts'


    Directory: \\?\C:\Windows\System32\drivers\etc


Path  Owner               Access
----  -----               ------
hosts NT AUTHORITY\SYSTEM NT AUTHORITY\SYSTEM Allow  FullControl...

PS C:\temp> copy  '\\?\C:\Windows\System32\drivers\etc\hosts' .
PS C:\temp> ls hosts


    Directory: C:\temp


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        16-7-2016     13:45            824 hosts

PS C:\temp>
No idea why it dowsn't work in your case ...
CrxtJ7tOs4Iq
Posts: 28
Joined: Wed Jan 14, 2015 2:19 pm

Re: File path length?

Post by CrxtJ7tOs4Iq »

NotNull wrote:
CrxtJ7tOs4Iq wrote:
NotNull wrote: PS C:\temp> $PSVersionTable
No idea why it dowsn't work in your case ...
good call on the PS version.
I was using 3... appears to work when tested on 5.

Thanks!
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: File path length?

Post by NotNull »

CrxtJ7tOs4Iq wrote: good call on the PS version.
I was using 3... appears to work when tested on 5.

Thanks!
You're welcome! Luckily it was the vrsion; otherwise I had no clue ..
Thanks for feedback!

BTW: did you bas64 encode your username? (m'N*)
CrxtJ7tOs4Iq
Posts: 28
Joined: Wed Jan 14, 2015 2:19 pm

Re: File path length?

Post by CrxtJ7tOs4Iq »

NotNull wrote:
CrxtJ7tOs4Iq wrote: BTW: did you bas64 encode your username? (m'N*)
Heh.... no....
it was just randomly generated.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: File path length?

Post by NotNull »

CrxtJ7tOs4Iq wrote: Heh.... no....
it was just randomly generated.
Nice coincidence...
Think I'll try this as a "password generator" ... password "Pasword" > base64 encoded: "UGFzc3dvcmQ=".
Easy to remember, hard to crack (well, until now, that is :D )

Good luck with your long file paths!
CrxtJ7tOs4Iq
Posts: 28
Joined: Wed Jan 14, 2015 2:19 pm

Re: File path length?

Post by CrxtJ7tOs4Iq »

NotNull wrote: Good luck with your long file paths!
man that \\?\ trick is sweet! makes me not really care.

Will rewrite my powershell script that is auditing permissions and all will be good.

Thanks again
user123
Posts: 28
Joined: Sat Jan 23, 2021 4:16 pm

Re: File path length?

Post by user123 »

therube wrote: Fri Mar 16, 2018 10:58 pm Adjust len: as needed.

Code: Select all

path:len:>254
Is it possible to just find file names that are certain length, for example 15 digits and chars while ignoring entire path ?

For example, I search 'twitter_account_ len:15' and it can't find anything unless I just use len:15 without additional search terms and with PATH disabled.
void
Developer
Posts: 16681
Joined: Fri Oct 16, 2009 11:31 pm

Re: File path length?

Post by void »

Are you looking for filenames with 15 characters after twitter_account_ ?

If so, please try:

regex:^twitter_account_.{15}$

regex: = enable regex.
^ = match start of filename.
. = match any character.
{15} = match previous element 15 times.
$ = match end of filename.



Do you want to ignore the extension? -please try:

regex:^twitter_account_.{15}\.[^.]*$



If you have match path enabled under the search menu, please try the nopath: search modifier:

nopath:len:15
nopath:regex:^twitter_account_.{15}$



Everything 1.5 will have support for:
len:name:15
len:stem:15
Post Reply