• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 502
  • Last Modified:

Long File Names using \\?\ is nuisance, any alternatives


I am using Delphi Xe2 and I need to use \\?\ to access files with deep folders.
I have to check my code and where ever there is User Interface I need to show without  \\?\  and whereever internal processing I need to use with \\?\.

Is there any better option.

  • 2
  • 2
  • 2
1 Solution
Sinisa VukCommented:
Use ExpandUNCFileName to get full path with computer name:

and ExpandFileName for internal use:

Allan_FernandesAuthor Commented:
I meant where filename > 255 chrs
Geert GOracle dbaCommented:
does anybody actually type in such a long file name ?
get serious !
there is a reason why it's limited to 255 chars:
  the human brain can't remember a path longer than that
how many times per day does anybody ask if they still know that path name ?

same problem here. in the end they had to admit they used shortcuts to the folder ...

if it's on a \\ path
create a shared folder on that server to the common deepest level it can go
then start from there

> share named "ooo" on server to c:\a\b\c\d\e\f\g\h\i\j\k\l\m\o

this then changes to
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Allan_FernandesAuthor Commented:
Since windows allows such paths users create it. I have a backup application, if I cannot backup the data then User does not purchase my package. I loose the client without any chance of explaining to him how he can make use of Shared folders.

What I need to know is, if there is a common logic that I can use for standard files and the ones > 255.
Sinisa VukCommented:
There are similar topics here:


...using unicode version of delphi (xe2 will do fine) and switch between \\?\ and local fine name with simple StringReplace function
Geert GOracle dbaCommented:
have you considered backing a system with a synchronous DR system  in place ?

the data ... most data resides in databases
the data files usually require a databases specific mechanism to do backups

windows ... so your software can restore a complete windows environment
without having access to the windows system itself ?

i hope you considered all those questions ... :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now