Starting win32 application from a long path

744 Views Asked by At

Enabling long path support for my application I have done the following:

  1. Embedded the longPathAware manifest into my application using mt.exe
  2. Ensured that the LongPathsEnabled registry key is set to 1

My application actually started to be able to operate on files located in folders with long paths exceeding the 260 limit, however there exists a problem.

I found no way to start my application where a long path folder is my current working directory. I have tried using cmd, MSYS2, CygWin, explorer

  1. cmd gives the following error:

    The current directory is invalid.
    
  2. MSYS2 and CygWin both give the following error:

     Error: Current working directory has a path longer than allowed for a Win32 working directory.
     Can't start native Windows application from here.
     bash: /c/myapp: File name too long
    
  3. explorer does the following:

    • The application icon becomes blank like the one for unknown file types or files with no extensions
    • Double clicking on the application does nothing whatsoever

It is the most common use case for my application to have the files on which the application operates upon in the current working directory. So, given that the current working directory can't exceed that limit means that all of this is kind of useless.

So, my question is: Is there a way to overcome this issue/limitation?

I feel like without having this case working, the whole long paths support doesn't make any sense.

0

There are 0 best solutions below