I have a small WPF application that takes file paths as command line arguments.
If the user drags too many files with long paths, he will exceed the maximum command line length, at least on 32-bit WinXP.
As a result, a window appears with an error message:
Windows cannot access the specified device, path, or file. You cannot have the appropriate permissions to access the item.
It seems like a mistake
The file name or extension is too long.
In these cases, it seems that the process never starts.
I thought that drag-and-drop files effectively simply pass their paths as strings, but these errors indicate the opposite, and that some part of the OS / shell / shell does some kind of verification based on the fact that this is the path to files / directories, and when this fails, the process does not start.
Does anyone know what happens between the moment when command line arguments are passed to .NET.exe and when this .exe is launched, if ever?
source share