1.10.1 Cannot open UNC paths if longer than 255 characters

*** Please try to reproduce your bug and confirm the bug fix. ***

Moderators: xnview, Dreamer

ugo92
Posts: 5
Joined: Mon Mar 02, 2026 9:13 am

1.10.1 Cannot open UNC paths if longer than 255 characters

Post by ugo92 »

XnView: MP 1.10.1 - 64 bit
OS: Windows - 64bit

It looks like the application cannot handle UNC paths longer than 255 characters

Effect: When you try to open files whose path is an UNC path and it's longer than 255 characters, XnView shows an Error dialog with "File not found!" written inside. Shorter file paths are handled just fine.
The difference between a shorter than 255 characters path and a longer than 255 charaters file paths is in the beginning of the path.
The longer one will start with \\?\UNC\server.domain.whatever while the shorter one starts with \\server.domain.whatever


To reproduce:
1. Try to open an image file whose file path is UNC and longer than 255 characters

Actual behaviour (bug): The application cannot find the file

Expected behaviour: The application open the chosen file
jkm
Posts: 497
Joined: Sat May 11, 2024 12:43 am

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by jkm »

Welcome to the forums...

Please read up on MAX_PATH, a historical limitation in Windows.

https://learn.microsoft.com/en-us/windo ... s=registry

To exceed it, you must explicitly enable LongPaths on your machine, individual applications must opt-in to it, and still not all Windows functions support it.

Have you enabled LongPaths?

Hopefully this sheds some light on what's going on.
User avatar
xnview
Author of XnView
Posts: 47709
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by xnview »

you enter in the pathname filed, a path like \\?\UNC\server.domain.whatever, right?
Pierre.
ugo92
Posts: 5
Joined: Mon Mar 02, 2026 9:13 am

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by ugo92 »

Thanks for your answers!
Have you enabled LongPaths?
Yes, LongPaths is enabled
you enter in the pathname filed, a path like \\?\UNC\server.domain.whatever, right?
No, i use windows file explorer to reach \\server.domain.whatever\level1\level2\...\levelN\ then i double click image.jpg to open it in XnViewMP.
If i go "deep enough" in the levels the file path becomes longer than 255 characters and the image doesn't open.
I checked its path with right click -> copy as path, that's where I noticed the differences in the beginning of the path
User avatar
xnview
Author of XnView
Posts: 47709
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by xnview »

ugo92 wrote: Wed Mar 04, 2026 8:38 am No, i use windows file explorer to reach \\server.domain.whatever\level1\level2\...\levelN\ then i double click image.jpg to open it in XnViewMP.
If i go "deep enough" in the levels the file path becomes longer than 255 characters and the image doesn't open.
I checked its path with right click -> copy as path, that's where I noticed the differences in the beginning of the path
i've sent you a test version
Pierre.
ugo92
Posts: 5
Joined: Mon Mar 02, 2026 9:13 am

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by ugo92 »

I'm very sorry, I just noticed this answer and the private message.
The link expired, if you can send it again I'm more than happy to test it

Thanks!
User avatar
xnview
Author of XnView
Posts: 47709
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by xnview »

please check 1.10.5
Pierre.
ugo92
Posts: 5
Joined: Mon Mar 02, 2026 9:13 am

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by ugo92 »

Just tried it, I've got the same "File not found!" pop up.
The path is 283 characters long, and it's starting with \\?\UNC\

Just to add some more information, if I open the same file from the same location with the "Photos" or "Paint 3D" app from Windows 11, it opens just fine

Thanks!
User avatar
xnview
Author of XnView
Posts: 47709
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by xnview »

ugo92 wrote: Fri Mar 27, 2026 8:54 am Just tried it, I've got the same "File not found!" pop up.
The path is 283 characters long, and it's starting with \\?\UNC\
i send you a PM
Pierre.
ugo92
Posts: 5
Joined: Mon Mar 02, 2026 9:13 am

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by ugo92 »

Thanks, I haven't received it yet
User avatar
xnview
Author of XnView
Posts: 47709
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by xnview »

ugo92 wrote: Mon Mar 30, 2026 9:16 am Thanks, I haven't received it yet
sent
Pierre.
User avatar
xnview
Author of XnView
Posts: 47709
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by xnview »

:bugconfirmed: Thanks to your detailed description I can reproduce the problem.
Pierre.
User avatar
xnview
Author of XnView
Posts: 47709
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.10.1 Cannot open UNC paths if longer than 255 characters

Post by xnview »

This problem is supposed to be fixed in XnView MP 1.11.1. Please check and confirm the bug fix here.
Pierre.