Open files with too long paths?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Biff
Posts: 1154
Joined: Mon May 25, 2015 7:09 am

Open files with too long paths?

Post by Biff »

Files having a to long path (more than 254 characters or so) are not opened. Is there a way to open them?
horst.epp
Posts: 1443
Joined: Fri Apr 04, 2014 3:24 pm

Re: Open files with too long paths?

Post by horst.epp »

You have to enable Long Path Support in Windows.
This works of course only if your applications can handle it.

Open Run command by pressing Windows + R and type Regedit and hit enter.
This command will open the Registry editor console.

Now navigate to the following path.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

From the left-hand side click on the FileSystem and from the right-hand side look for the DWORD named LongPathsEnabled.

Double click on the LongPathsEnabled DWORD and set the Value data as 1 and click on OK.
Biff
Posts: 1154
Joined: Mon May 25, 2015 7:09 am

Re: Open files with too long paths?

Post by Biff »

Thank you very much!

Does enabling that have any drawbacks?
horst.epp
Posts: 1443
Joined: Fri Apr 04, 2014 3:24 pm

Re: Open files with too long paths?

Post by horst.epp »

Biff wrote: Sat Aug 26, 2023 7:03 am Thank you very much!

Does enabling that have any drawbacks?
No.
But as I said, it doesn't help you if the applications you are using can't handle long paths.
Biff
Posts: 1154
Joined: Mon May 25, 2015 7:09 am

Re: Open files with too long paths?

Post by Biff »

Okay. Yes, but it seems like most of them here can handle paths that are too long.

Many thanks!
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Open files with too long paths?

Post by therube »

Files having a to long path (more than 254 characters or so) are not opened.
How, & in what, are you trying to open them?


(It's been ages since I've run into issues opening LFN - with Everything being the "source" to the file.
It is only [mainly] because of Everything that I can handle LFN so well.

Using Win7, so no "Long Path Support" here.)
Biff
Posts: 1154
Joined: Mon May 25, 2015 7:09 am

Re: Open files with too long paths?

Post by Biff »

How, & in what, are you trying to open them?
By double clicken the folder or file.

With these programs:

Code: Select all

[{"filter"="*.3g2;*.3gp;*.3gp2;*.3gpp;*.amr;*.amv;*.asf;*.avi;*.bdmv;*.bik;*.d2v;*.divx;*.drc;*.dsa;*.dsm;*.dss;*.dsv;*.evo;*.f4v;*.flc;*.fli;*.flic;*.flv;*.hdmov;*.ifo;*.ivf;*.m1v;*.m2p;*.m2t;*.m2ts;*.m2v;*.m4b;*.m4p;*.m4v;*.mkv;*.mp2v;*.mp4;*.mp4v;*.mpe;*.mpeg;*.mpg;*.mpls;*.mpv2;*.mpv4;*.mov;*.mts;*.ogm;*.ogv;*.pss;*.pva;*.qt;*.ram;*.ratdvd;*.rm;*.rmm;*.rmvb;*.roq;*.rpm;*.smil;*.smk;*.swf;*.tp;*.tpr;*.ts;*.vob;*.vp6;*.webm;*.wm;*.wmp;*.wmv","command"="$exec(\"J:\\PortableApps\\PortableApps\\MPC-HCPortable\\MPC-HCPortable.exe\" \"%1\")"}{"filter"="*.txt;*.ini","command"="$exec(\"J:\\Programme\\Notepad++\\notepad++.exe\" \"%1\")"}{"filter"="*.odt;*.ott;*.docx;*.doxt;*.doc;*.dot","command"="$exec(\"J:\\PortableApps\\PortableApps\\LibreOfficePortable\\LibreOfficeWriterPortable.exe\" \"%1\")"}{"filter"="*.ani;*.bmp;*.gif;*.ico;*.jpe;*.jpeg;*.jpg;*.pcx;*.png;*.psd;*.tga;*.tif;*.tiff;*.wmf;*.cr2","command"="$exec(\"J:\\Programme\\XnViewMp\\xnviewmp.exe\" \"%1\")"}{"filter"="*.ods","command"="$exec(\"J:\\PortableApps\\PortableApps\\LibreOfficePortable\\LibreOfficeCalcPortable.exe\" \"%1\")"}{"filter"="*.pdf","command"="$exec(\"J:\\Programme\\PDF-XChange Editor Plus\\PDF-XChange Editor.exe\" \"%1\")"}{"filter"="*.scrivx","command"="$exec(\"C:\\Program Files\\Scrivener3\\Scrivener.exe\" \"%1\")"}{"filter"="*.7z;*.ace;*.arj;*.bz2;*.cab;*.gz;*.gzip;*.r00;*.r01;*.r02;*.r03;*.r04;*.r05;*.r06;*.r07;*.r08;*.r09;*.r10;*.r11;*.r12;*.r13;*.r14;*.r15;*.r16;*.r17;*.r18;*.r19;*.r20;*.r21;*.r22;*.r23;*.r24;*.r25;*.r26;*.r27;*.r28;*.r29;*.rar;*.tar;*.tgz;*.z;*.zip","command"="$exec(\"J:\\Programme\\WinRar\\WinRAR Portable.exe\" \"%1\")"}{"filter"="*.html;*.url","command"="$exec(\"J:\\PortableApps\\PortableApps\\FirefoxPortable\\FirefoxPortable.exe\" \"%1\")"}]
What is LFN?
Using Win7, so no "Long Path Support" here.)
Sorry?
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Open files with too long paths?

Post by therube »

What is LFN?
LongFileName (be it long paths &/or name itself).
Using Win7, so no "Long Path Support" here.
Ordinarily file paths > ~260 chars "do not work".
Win10/11 have LPS which allow for ~32K paths (though each segment of the path must be < 256 chars).

Win7 does not have a "simple" way (like LPS) to "enable" long paths.

And after all that, the programs you use also need to be LFN "aware".

So...

I'll suspect that something like,
[{"filter"="*.mp4","command"="$exec(\"J:\\PA\\PA\\MPC-HC\\MPC-HCPortable.exe\" \"%1\")"}]
is not taking (& "converting) your "LFN" (to SFN) & sending the SFN (ShortFileName) to MPC. And MPC, not being able to handle the LFN, fails.

That is different from what happens if you were to double-click the filename or use SendTo to open, where, if needed, the LFN is "converted" to a SFN, which MPC can then handle...

---

I'll take it that J: is an actual flash drive (rather then simply an "install" of MPC, "portable", on your HDD)?
horst.epp
Posts: 1443
Joined: Fri Apr 04, 2014 3:24 pm

Re: Open files with too long paths?

Post by horst.epp »

MPC-HC has no problems using long paths for any media file.
There is no need at all here to provide a short file name.
Starting with Windows 10, all the user needs is enabling Long path support.
Biff
Posts: 1154
Joined: Mon May 25, 2015 7:09 am

Re: Open files with too long paths?

Post by Biff »

I'll take it that J: is an actual flash drive (rather then simply an "install" of MPC, "portable", on your HDD)?
J: is a partition of three (on one of them, C:, Win 11 is installed) on an 512 GB SSD and MPC is a portable version.
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Open files with too long paths?

Post by therube »

J: is a partition of three (on one of them, C:, Win 11 is installed) on an 512 GB SSD
Then is there a particular reason for "portable"?
As in if the reason you want "portable" is that you have something you can unzip... (but then you can just download the ZIP version...)...

OK, so then just what is the reason for "portable"?
Why not just associate MPC with the file extensions you want, so not portable in that respect, so that the associations are in Windows (Registry), then you wouldn't need "special" commands in Everything to open said files.
(This is assuming the MPC is also your default media player.)
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Open files with too long paths?

Post by therube »

Starting with Windows 10, all the user needs is enabling Long path support.
But otherwise, without LPS enabled, MPC + Win10 would fail on said LFN file?


(That is what happens in Win7, MPC + LFN fails.
"Fails", except when Everything is brought into the picture.)

real sample file name:

Code: Select all

C:\TMP\BRU\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx012345678999-255.char.name.وبة فنية كبيرة.jpg.txt.NoScriptBug.cleaned.mp4
Biff
Posts: 1154
Joined: Mon May 25, 2015 7:09 am

Re: Open files with too long paths?

Post by Biff »

Then is there a particular reason for "portable"?
Yes, much easier to handle for me, for example when using a new computer, re-installing Win, with back ups, restoring, problems with the computer, etc.
As in if the reason you want "portable" is that you have something you can unzip... (but then you can just download the ZIP version...)...
Sorry, I do not understand. What does that mean?
Why not just associate MPC with the file extensions you want, so not portable in that respect, so that the associations are in Windows (Registry), then you wouldn't need "special" commands in Everything to open said files.
Because I would have to do it again after each (re-)installation, on new computers, etc. I then just could go on using the programs like before. Without having to re-do. Usually there are only two programs I open files, folders in.
(This is assuming the MPC is also your default media player.)
To take a quick look at movies. Actually it is Kodi.
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Open files with too long paths?

Post by therube »

As in if the reason you want "portable" is that you have something you can unzip
Your reason for portable is valid, so just unzipping 'MPC-HC.1.9.24.x64.zip' would not accomplish what you're after.

And as MPC is not your default player, using Everything as you are with '"filter"="*.mp4"' is also valid means to an end.
Biff
Posts: 1154
Joined: Mon May 25, 2015 7:09 am

Re: Open files with too long paths?

Post by Biff »

Oops! Okay, I am not quite sure, but is sounds like everything should be fine.

Many thanks!
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Open files with too long paths?

Post by therube »

OT:

Exploring a Win10 machine, briefly, & no idea about LPS (though I assume it is not enabled, unless the "current" version of 10 enabled it), & using Windows Explorer...

It did seem to open a "LFN" (255 char filename + path, resulting > 260 total), as is.
Different programs appeared to handle it differently (opening a .TXT file, using SendTo).
Notepad, opened the file with a LFN.
Wordpad, opened the file with a SFN.
Win32pad, opened the file with a SFN.

No idea why the difference.
(That's about as much as I [could take it] & explored.)


Posting this as it is a recent article (where most others are "old") & what one developer came up with:
Path length limit on Windows.
void
Developer
Posts: 16670
Joined: Fri Oct 16, 2009 11:31 pm

Re: Open files with too long paths?

Post by void »

SendTo uses the shortname for very long paths.

My guess is Notepad converts the shortname parameter to the long path name.
Other programs will just use the supplied shortname.
Post Reply