Author Topic: Increasing MDOS Environment limit  (Read 2477 times)

Doug Clark

  • Sr. Member
  • ****
  • Posts: 336
  • Karma: +9/-1
    • View Profile
Increasing MDOS Environment limit
« on: August 17, 2024, 12:56:28 am »
I believe the maximum for all environment variables in DOS, and hence Win-OS/2, is 160 characters.

Is there some setting that I am missing to increase this limit in DOS and Win-OS/2 sessions?


Dave Yeo

  • Hero Member
  • *****
  • Posts: 4980
  • Karma: +109/-1
    • View Profile
Re: Increasing MDOS Environment limit
« Reply #1 on: August 17, 2024, 06:03:19 am »
Isn't that simply a DOS limit? You could use a different version of DOS perhaps.

Doug Clark

  • Sr. Member
  • ****
  • Posts: 336
  • Karma: +9/-1
    • View Profile
Re: Increasing MDOS Environment limit
« Reply #2 on: August 17, 2024, 07:12:05 am »
Dave,

There is the /E:x  switch you can use with COMAND.COM for increasing the environment size upto 32768 when running the DOS command processor - and the lowest value you can set with /E:x is 160 - which is the DOS default.  I was just hoping there was some setting in the DOS properties that I was missing that would act like /E:x does for COMMAND.COM.  Plus it appears that COMMAND.COM only works for DOS sessions - my concern is for Win-OS/2 sessions.

The limit for PATH in DOS is 80 characters.  The default AUTOEXEC.BAT for AOS 5.1 has a path that is 75 characters. So there is no way to add an application to the PATH without taking something out of the default PATH - like for example C:\SYS\MDOS\BIN\

And when the PATH is at 80 characters that leaves just 80 characters for everything else in the environment.  So, for example, if you have a number of drives, unREMarking the SET DELDIR=  line will throw you over the 160 character limit.

I was just hoping I was missing something here, or there was some magic setting I was unaware of.

Thanks


Lars

  • Hero Member
  • *****
  • Posts: 1345
  • Karma: +68/-0
    • View Profile
Re: Increasing MDOS Environment limit
« Reply #3 on: August 17, 2024, 12:31:54 pm »
For whatever DOS program you use, try to change the DOS_SHELL setting for it to include the /E:32768 switch.
No clue if that will work but you can give it a try.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4980
  • Karma: +109/-1
    • View Profile
Re: Increasing MDOS Environment limit
« Reply #4 on: August 17, 2024, 05:32:31 pm »
Perhaps as simple as adding the /E:32768 to the parameters in the DOS Session Properties?

Lars

  • Hero Member
  • *****
  • Posts: 1345
  • Karma: +68/-0
    • View Profile
Re: Increasing MDOS Environment limit
« Reply #5 on: August 17, 2024, 07:15:55 pm »
There is no place except for DOS_SHELL in the DOS properties

Sean Casey

  • Full Member
  • ***
  • Posts: 126
  • Karma: +2/-0
    • View Profile
Re: Increasing MDOS Environment limit
« Reply #6 on: August 17, 2024, 11:43:54 pm »
Is there some setting that I am missing to increase this limit in DOS and Win-OS/2 sessions?

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

  • Sr. Member
  • ****
  • Posts: 336
  • Karma: +9/-1
    • View Profile
Re: Increasing MDOS Environment limit
« Reply #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
« Last Edit: August 21, 2024, 04:17:16 am by Doug Clark »

Wim Brul

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: Increasing MDOS Environment limit
« Reply #8 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.

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

Code: [Select]
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;

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

Code: [Select]
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;

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

Sean Casey

  • Full Member
  • ***
  • Posts: 126
  • Karma: +2/-0
    • View Profile
Re: Increasing MDOS Environment limit
« Reply #9 on: August 21, 2024, 03:50:33 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: [Select]
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;
ND.COM H:\OS2\MDOS /E:1024 in my CONFIG.SYS.

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