http://support.microsoft.com/kb/830473/en-us says that the "Command Prompt ignores any environment variables that are inherited from the parent process and are longer than its own limitations of either 2047 or 8191 characters (as appropriate to the operating system)". This appears to be only partly true - the prompt (and batch files) recognize such a variable to exist ("if defined" succeeds), but can't access its contents, not even the first character.

Following was tried under xp.sp3 and win7.sp1.x64 with identical results. The parent vb-script creates the long variables

Also in line with this, as per viewtopic.php?f=3&t=4312 if you use a cmdcmdline substring / string replacement to ''empty'' the cmdcmdline env var, it will still count as ''defined'' even if it is an empty string.