Xref: utzoo comp.binaries.ibm.pc.d:13582 comp.sys.ibm.pc.misc:8364 comp.os.msdos.misc:1696 comp.os.msdos.programmer:4510 alt.msdos.programmer:2532 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!csus.edu!ucdavis!csusac!usenet From: laned@athena.ecs.csus.edu (Douglas A. Lane) Newsgroups: comp.binaries.ibm.pc.d,comp.sys.ibm.pc.misc,comp.os.msdos.misc,comp.os.msdos.programmer,alt.msdos.programmer Subject: how to modify the parent DOS environment ?? Message-ID: <1991Apr8.183155.22185@csusac.csus.edu> Date: 8 Apr 91 18:31:55 GMT Sender: usenet@csusac.csus.edu (News account (alt)) Organization: California State University, Sacramento Lines: 51 All: I have seen a zillion environment editors, but I want to do something very simple.. that has "avoided" me.. to change or set a environment variable. Unfortunately the change done in my program is not permanent (see the example below). Another wrinkle: if there are 3 shelled programs (versions of COMMAND.COM in memory) allow the program to modify only the parent, or all the parent environments. Respond by e-mail please, any help would be appreciated. Doug For example: Write a program (called X) to set a env. var. called "HOME" to whatever is on the command line. This is what happens when I wrote a test program in C. Note the second set statement HOME is NO WHERE to be found. C> SET COMSPEC=C:\COMMAND.COM PATH=C:\;C:\DOS; PROMPT=$P $G C> X THIS IS A TEST ; print current environment COMSPEC=C:\COMMAND.COM PATH=C:\;C:\DOS; PROMPT=$P $G HOME=THIS IS A TEST C> SET COMSPEC=C:\COMMAND.COM PATH=C:\;C:\DOS; PROMPT=$P $G - end example - daLane (laned@athena.ecs.csus.edu) ---------------------------------------------------------------------------- The opinions expressed are mine alone and do not reflect any organization unless noted. ============================================================================ "The best religion, is tolerance" "Take a stand, but not on my feet please." -me ---------------------------------------------------------------------------- "Men are disturbed not by things that happen but by their opinion of things that happen." Epictetus ----------------------------------------------------------------------------