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

codekaizen
  • 26,990
  • 7
  • 84
  • 140
  • related: https://superuser.com/questions/1385854/how-do-i-bypass-restrictions-on-the-length-of-the-path-variable – XoXo Apr 28 '21 at 12:55

2 Answers2

8

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.

wihlke
  • 2,455
  • 1
  • 19
  • 18
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.

Radek Svoboda
  • 177
  • 1
  • 8