New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect behavior running executable if current location path is longer than 256 characters #13955
Comments
I think this may be an actual limitation in CreateProcess. When querying info about setting the current directory that exceeds MAX_PATH I got back this info MicrosoftDocs/feedback#1441. |
Seems a valid reason. But shouldn't PowerShell warn about it / yield a well-defined error if this is attempted? |
Sure, just wanted to share some background info that seemed to be relevant. |
Interesting, is there still a problem with launching programs from long paths in PowerShell, even when As part of my research into Node.js support of long paths on Windows I've experienced that running PS C:\> node -v
v20.5.1
PS C:\> mkdir long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\
Directory: C:\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\l
ong-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-p
ath\long-path\long-path\long-path\long-path
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 17.11.2023 16:27 long-path
PS C:\> cd long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\
PS C:\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path\long-path> node -v
Program 'node.exe' failed to run: The directory name is invalidAt line:1 char:1
+ node -v
+ ~~~~~~~.
At line:1 char:1
+ node -v
+ ~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed More details over here: |
I can also open a new issue if that would be better, since this is not 100% the same issue... cc @iSazonov |
The problem repro'es with 7.4.0 on Windows 11 build 10.0.22621.2715.amd64fre.ni_release.220506-1250 |
@iSazonov @jborean93 @daxian-dbw @SteveL-MSFT can this issue be reopened? I think it should not be closed. |
This issue appears to apply to ALL executables. Here, I'm just trying to run I can open Cmd to the same folder and have no problem running the same Exe. It's ironic that the ancient Cmd.exe is more capable in this regard: And yes, that really is the same folder. It's more clear if I change my PowerShell prompt to 8.3 format. Of course, that does nothing to fix the problem: And, finally, before anyone asks; Yes, LongPathsEnabled is already set to 1 (enabled). |
Steps to reproduce
If the path to the current location is > 256 characters, running an executable from PowerShell either fails or works but the executable is run in a separate console.
Expected behavior
Running an executable should work and output to the current console, whatever the current location.
Actual behavior
If the path to the current location is > 256 characters long, running an executable either fails or is done in a separate console, yielding no output in the current console.
Environment data
The text was updated successfully, but these errors were encountered: