I'm currently searching for a way to overcome the limit off the environment variable length on Window OS, and the maximum limit I have achieved is 4133. But for my project, I need to check the system installation with longer path environment (8000, 16000 or even the maximum 32000).
setx command is out, since it automatically truncated the path environment to 1024 character.
I have tried the API SetEnvironmentVariable() of PowerShell and it seems to have limit of ~4133 character, the rest is automatically truncated or not function properly.
Is there anyway to overcome this limit ?
%PATH%for verification anyway. Why don't just use an absolute path, or just CD into the folder? I'm sure there are a lot of redundant paths in the variable. And even if the length is still too long you can easily mount the path to a shorter one withsubst,mountvolor a symbolic link. Overcoming the 1024 character limit with setx – phuclv Oct 22 '18 at 06:05%PATH%variable is 2047/4095 characters, https://support.microsoft.com/en-us/help/2685893/error-messages-after-you-change-the-2047-character-limit-in-an-environ, https://blogs.msdn.microsoft.com/oldnewthing/20100203-00/?p=15083 – phuclv Oct 22 '18 at 06:05