Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!hao!oddjob!gargoyle!ihnp4!ihlpm!leder From: leder@ihlpm.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: Cannot putenv() in MSC 4.0 Message-ID: <1139@ihlpm.ATT.COM> Date: Wed, 20-May-87 16:41:50 EDT Article-I.D.: ihlpm.1139 Posted: Wed May 20 16:41:50 1987 Date-Received: Sat, 23-May-87 00:37:10 EDT References: <2301@tekgvs.TEK.COM> Distribution: na Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 26 Keywords: pushd,popd,putenv,Turbo Pascal,Microsoft C V4.0 Summary: putenv with undoc dos intrpt In article <2301@tekgvs.TEK.COM>, toma@tekgvs.TEK.COM (Thomas Almy) writes: > > > > I had been using a clever version of PUSHD/POPD, written in Turbo Pascal, ... > to rewrite these programs. After all, the hard work in the Turbo program > was to do the getenv and putenv operations. Writing these programs in C > should have proved to be a snap. > > But putenv() does not appear to actually set the environment! Just the one > local to the program! What good is this?? Obviously, for your purposes it was not any good at all, but you were close to the right solution. There is an undocumented dos interrupt (i think that its 32, but i'm sure someone will help with the number. It was reported in PC Mag. This interrupt sends a command for the lowest level COMMAND.COM to execute, which since its environment pointer is still at the right place, causes changes to the low level environment after the caller has exited. First you may need to use the SETENV command that came with Microsoft C to expand the size of your environment. Bob Leder - just adding confusion to the chaos