[comp.sys.ibm.pc.misc] shrinking enviroment size

boerner@ut-emx.uucp (Brendan B. Boerner) (03/16/91)

My configuration:
	HP Vectra QS/16S w/4MB
	HP DOS v3.30
	Qualitas 386Max v5.1

I've found that when trying to run batch files from within/when
shelled out from other programs (from the process buffer in Epsilon,
in the Windows DOS box, shelling out from Turbo C++, etc...), I have
very little enviroment room to add variables to.  I should have enough
room, I'm setting my enviroment size to 4K in config.sys (I bumped it
up there I noticed this happening and haven't dropped back down.
Doing a SET > TMP.TXT reports that TMP.TXT is less than 1K in size).
I'm now guessing that either DOS will take the current size of the
enviroment and use that for spawned programs, or the programs will
limit the enviroment themselves.

Does anyone know how I can get around this behavior?

Thanks in advance,
Brendan

mcastle@mcs213e.cs.umr.edu (Mike Castle {Nexus}) (03/17/91)

Sounds less like running out of environment space than not quite knowing how
DOS handles child processes.

Each DOS child process (program, dos shell, etc) gets it's own set of
envirment variables.  When you change those variables from withing that program
(such as a DOS shell), it only effects those variables, leaving the parents
environments variables alone (this doesn't occur with batch files, of course,
that's why you can set environment variables from batch files).  

You can see this by starting another command shell (by type COMMAND at the 
dos prompt, changing/adding/deleting an environment variable, typing EXIT to
leave that spawned environment, then looking at the set of environment vars in
the parent process (the regular dos prompt).  The variable *should* be
unchanged.

There is a way of tracing the pointers back to the originall environent table, 
and changing it directly.  Some of the following programs may do that (I don't
know, as I've not used any of them), and you may want to try some of them.

APPENV21.ARC PD1:<MSDOS.SYSUTL> Append text to environment variables, v2.1
CHGENV.ZIP   PD1:<MSDOS.SYSUTL> MS-DOS environment editor, add/delete/change
DCSETENV.ARC PD1:<MSDOS.SYSUTL> Set environment variables from command line
EE2.ARC      PD1:<MSDOS.SYSUTL> Edit environment while in DOS - F1 for help
ENV.ARC      PD1:<MSDOS.SYSUTL> Keep environment full size for child processes
ENV.ZIP      PD1:<MSDOS.SYSUTL> Edit current or master environment variables
ENVEDIT.ZIP  PD1:<MSDOS.SYSUTL> Interactive DOS environment editor
RBSETNV1.ZIP PD1:<MSDOS.SYSUTL> Set/add/insert/delete/change environment vars.
SETENVJW.ZIP PD1:<MSDOS.SYSUTL> Set environment variables, v1.4, w/ASM source
SETPGMS.ARC  PD1:<MSDOS.SYSUTL> Environment utilities DOS 3.1 - 3.3

These are all available at:
New Mexico:  simtel20.army.mil (26.2.0.74) in the directory listed above
                                           (PDx:<MSDOS.xxxxx> )
Missouri:    wuarchive.wustl.edu (128.252.135.4) in mirrors/msdos/xxxxx
Australia:   sol.deakin.oz.au (128.184.1.1) in pub/PC/simtel-20/xxxxx
 
There are several mail servers that will process the ftp commands for those who
have access to e-mail, but not FTP.  Addresses are:
 
In North America (Simtel20 access only):
 
          LISTSERV@VM1.NODAK.EDU   North Dakota State University.
          LISTSERV@VM.ECS.RPI.EDU  Rensselaer Polytechnic Institute.
 
    In the body of the mail have the command:
    GET PDGET HELP 
 
Also (any ftp site):
          BITFTP@PUCC.PRINCETON.EDU
 
   In the body of the mail have the command:
   HELP
 
Trickle servers (Simtel20 access only):
In Denmark:     TRICKLE@DKTC11
In Turkey:      TRICKLE@TREARN
In Italy:       TRICKLE@IMIPOLI
In Belgium:     TRICKLE@BANUFS11
In Austria:     TRICKLE@AWIWUW11
In Germany:     TRICKLE@DTUZDV1
In Spain:       TRICKLE@EB0UB011
In Israel:      TRICKLE@TAUNIVM
In Netherlands: TRICKLE@HEARN
France:         TRICKLE@FRMOP11
Germany:        TRICKLE@DB0FUB11
Chile:          TRICKLE@USACHVM1
Not sure:       TRICKLE@DS0RUS1I
 
(note:  these are EARN/BITNET style addresses.  Internet users should
        use BITNET domain addresses such as TRICKLE@TREAN.BITNET)
 
    In the body of the mail have the command:
    /HELP
 
If anyone knows of any other mirrored archives of Simtel20, please let me
know and I'll add them to this generic response.
 
Thanks.
-- 
Mike Castle (Nexus) S087891@UMRVMA.UMR.EDU (preferred)       | XEDIT: Emacs
                mcastle@mcs213k.cs.umr.edu (unix mail-YEACH!)| on a REAL
Life is like a clock:  You can work constantly, and be right | operating
all the time, or not work at all, and be right twice a day.  | system. :->

boerner@ut-emx.uucp (Brendan B. Boerner) (03/22/91)

In article <2419@umriscc.isc.umr.edu> mcastle@mcs213e.cs.umr.edu (Mike Castle {Nexus}) writes:
>Sounds less like running out of environment space than not quite knowing how
>DOS handles child processes.

Sorry if I was unclear, the problem is not that I want to change
the enviroment and have the changes propagate up, but rather, when
I am in Window's DOS box, or have spawned to DOS in another program,
I have problems since the batch files which I use to run programs
cannot add to the enviroment (because DOS shrinks it when I run
the program I've spawned out of).

In any case, one of the programs you mentioned may do what I want:
>ENV.ARC      PD1:<MSDOS.SYSUTL> Keep environment full size for child processes

Thanks for the response.  Thanks also to Richard Brittain
<richard@calvin.ee.cornell.edu> for his response.  He recommended
that I dump command.com in favor of 4Dos.

Brendan