7
« on: August 21, 2024, 04:07:10 am »
Lars - thanks for the DOS_SHELL setting. It seems so obvious, after you pointed it out.
So the conclusion is:
1) According to multiple sources, the maximum length of a fully qualified path and file name, i.e. path+file name+ extension, is 80 characters.
2) According to my testing, using the attached program, the maximum length of the PATH statement in AUTOEXEC.BAT is 122 characters; 128 characters if you include the PATH= in the total.
3) It appears that the default max size of the environment is larger than 160 characters - but not much more.
4) it also appears there is a maximum for a single environmental variable of 128 characters, including the name and equal sign
5) You can change the max size of the environment with the DOS_SHELL setting. For example I specified a size of 4096 for testing, as shown below
C:\OS2\MDOS\COMMAND.COM C:\OS2\MDOS /E:4096
It appears the system reads the AUTOEXEC.BAT file from top to bottom, placing items in the environment as it reads them, and truncates everything past the max limit.
Thanks everyone for your help.
The attached program runs in Win-OS/2 and lists the environment variables in a list box, displaying the contents of the selected variable on the screen. It comes from Charles Petzold's Programming Windows 3.1 book