3

I want to set an environment variable in Windows 10, but it fails with an error:

This environment variable is too large. This dialog allows setting values up to the 2047 characters.

I'm learning React-Native and using android studio, I want to include the path to abd.exe in my %PATH% environment variable.

I tried to fix this by removing some of the values in the PATH variable, but I still get this same error.

Error Screenshot:

env variable too large error

I will appreciate this if anyone can assist me to solve this problem.

Thank you in advance for your assistance

1

2 Answers 2

9

I would recommend cleaning the PATH variable up, removing anything you no longer need. You can also reduce the length by adding new environment variables like

x86 = %ProgramFiles(x86)% x64 = %ProgramFiles% 

And refer to them by %x86%, etc. This also makes the PATH variable more manageable.

Sign up to request clarification or add additional context in comments.

2 Comments

you can even include `C:\` to optimize a bit further.
Yes, this is true. Windows should have shorter variable names and Winget should use them more often. I got the same problem after installing several tools with Winget and now I have to do the cleaning manually.
6

It seems to me that a recent Windows Update changed the allowed length of an environment variable from 4095 to 2047. I hope this is a bug not a feature. I have the same issue, getting error trying to save unmodified PATH environment variable results in "This variable is too large" error.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.