Windows: Max environment var length only 1024


  • Anonymous


    As a long term user, I've been suffering from a serious bug of Console2:
    Despite the fact that Win Vista/7 have significantly longer string length for environment variables,
    Console keeps using 1024. And this has caused various problems e.g., truncation of %PATH%.

    Can someone find a way to fix it?
    I tried to rebuild Console myself, but I keep getting this missing FreeImagePlus.dll issue even though
    I've had that dll under the exe folder…

  • Kirill

    I cannot find 1024 limitation anywhere in Console's code. Could you please provide a scenario that would show 1024 limit?

  • For me the limit is 1070 which is a really annoying as I have a lot of things in my path which I need to use.

    I too can't see anything in the code which would be limiting the path so I am quite confused as to what's wrong.

  • In normal cmd my full path is shown, it's just inside Console2 that it isn't so unfortunately I don't think the article can't help this problem.

  • Ronald

    Is only PATH shortened, or does the limit apply to other environment variables as well?

  • Previous message correction: *can

    I've just created a variable TMPVAR and stuck my path in it and it's not being shortened so it's only the PATH variable.

  • Ronald

    In this case, the interesting question is not, why it is shortened under Console, but why it is NOT shortened when running in a normal command Window.  If I understand your original posting correct, you are using Vista or 7. Now Microsoft says that shortening the PATH is the expected behaviour. From :

    The PATH environment variable has a fixed limit of 1023 usable characters. There does not appear to be a way to extend this.

    This was responded by a Microsoft Support Engineer. Hence, how unfortunate this silly restriction might be, it is not something where Console could help….

  • What is odd is how Console sees it as 1070 characters and not 1023 and cmd sees it as >1070…

  • Maximus5

    Strange… Cant reproduce the problem in my Windows 7 x64.
    Path var is 2310 chars long on my system
    and cmd.exe, started in Console or ConEmu, shows full variable length.

  • How bizzare…

    Are you using a x64 bit build by any chance?

    I wonder if it's the fact I'm using 32bit Console2…

  • *an

  • Maximus5

    No. Checked both 32 and 64 bit versions. Works fine.

  • That's really bizzare…

    I wonder what is causing this for the OP and me…

  • To add to this post, I have recently noticed my path is now working properly (over 1024) characters in console2 too.

    I think the fix was to manually edit my path and just click OK. No idea why *shrugs*.