[comp.sys.ibm.pc] Help! Info wanted of Environment Variable Access

jmv@sppy00.UUCP (Jim Vickroy) (10/31/88)

Help!   Does anyone have any information about a *reliable* means to gain accessto the DOS envrinment variables via a program. I want to be able to change the  PATH and a couple of others.

Thanks in advance.

-- 
!============================================================================!
! Jim Vickroy                    | cbosgd!osu-cis!sppy00!jmv - jmv@sppy00    !
! Online Computer Library Center | "Catch the blue train                     !
! Dublin, Ohio                   |       All the way to Kokomo"  - jrr       !

everett@hpcvlx.HP.COM (Everett Kaser) (11/02/88)

There are two bytes in your PSP (Program Segment Prefix) at offset 0x2c that
contain the segment address of your environment block.  However, this doesn't
tell you how LONG the environment memory block is; I think you would have to
"cheat" and look in the memory control block that immediately precedes the
environment segment to find the length of the segment, in order to know if
you have room in the segment to expand a variable's length.  (hell of a
sentence, huh?).  What you want to do is perfectly possible, but is not
supported in anyway by DOS, so you get into a LOT of dirty tricks trying to
do it.

Everett Kaser
!hplabs!hp-pcd!everett