OS/2, eCS & ArcaOS - Technical > Programming

Increasing MDOS Environment limit

<< < (2/2)

Lars:
There is no place except for DOS_SHELL in the DOS properties

Sean Casey:

--- Quote from: Doug Clark on August 17, 2024, 12:56:28 am ---Is there some setting that I am missing to increase this limit in DOS and Win-OS/2 sessions?

--- End quote ---

If you ever figure out a solution, please post a follow up.   

What I do to get around the path statement limitation is to set up a seamless win-os2 session icon for the Windows application.  I then store a separate autoexec.bat in the application's directory and reference this in the application icon's WIN-OS2 "DOS_AUTOEXEC" setting.

Doug Clark:
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

Wim Brul:
There is light at the end of the tunnel. You may use the SET command to produce larger environment variables.

So rather than unREMarking the SET DELDIR= line you could use the following:


--- Code: ---SET DELDIR=C:\DELETE,512;D:\DELETE,512;E:\DELETE,512;F:\DELETE,512;G:\DELETE,512;H:\DELETE,512;M:\DELETE,512;N:\DELETE,512;
SET DELDIR=%DELDIR%O:\DELETE,512;Q:\DELETE,512;S:\DELETE,512;Z:\DELETE,512;

--- End code ---

Similarly for the PATH= line you could add SET PATH=%PATH% line(s) as follows:


--- Code: ---PATH=H:\OS2\MDOS;H:\OS2;H:\;H:\OS2\MDOS\WINOS2;H:\TCPIP\DOS\BIN;H:\SYS\MDOS\BIN;
SET PATH=%PATH%E:\WIM\STUDIE\MDOS;G:\ENVIRON;

--- End code ---

I have SHELL=H:\OS2\MDOS\COMMAND.COM H:\OS2\MDOS /E:1024 in my CONFIG.SYS.

Sean Casey:

--- Quote from: Wim Brul on August 21, 2024, 12:03:37 pm ---There is light at the end of the tunnel. You may use the SET command to produce larger environment variables.

Similarly for the PATH= line you could add SET PATH=%PATH% line(s) as follows:


--- Code: ---PATH=H:\OS2\MDOS;H:\OS2;H:\;H:\OS2\MDOS\WINOS2;H:\TCPIP\DOS\BIN;H:\SYS\MDOS\BIN;
SET PATH=%PATH%E:\WIM\STUDIE\MDOS;G:\ENVIRON;

--- End code ---
ND.COM H:\OS2\MDOS /E:1024 in my CONFIG.SYS.

--- End quote ---

Referencing %PATH% will concatenate the PATH statement with the SET statement, it will not overcome the PATH statement's 128 characters size limitation.  Starting with DOS 6, you could overcome this limitation using a SET statement in config.sys

Navigation

[0] Message Index

[*] Previous page

Go to full version