home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ncoast!brown
- From: brown@NCoast.ORG (Stan Brown)
- Subject: Re: How can you set an environment variable in a program?
- Organization: Oak Road Systems, Cleveland Ohio USA
- Date: Wed, 26 Aug 1992 00:34:44 GMT
- Message-ID: <BtKExx.Jo0@NCoast.ORG>
- References: <1345@rand.mel.cocam.oz.au> <690@aardvark.Rain.COM> <1992Aug24.143641.1@camins.camosun.bc.ca>
- Lines: 25
-
- This is why we have an FAQ list, folks. Here's the relevant excerpt:
-
- Q704. How can a program set DOS environment variables?
-
- Program functions that read or write "the environment" typically
- access only the program's copy of the environment. What this Q
- really wants to do is to modify the active environment, the one that
- is affected by SET commands in batch files or at the DOS prompt.
- You need to do some programming to find the active environment, and
- that programming varies for different versions of DOS.
-
- A fairly well-written article in {PC Magazine} volume 8 number 20
- (1989 Nov 28), pages 309-314, explains how to find the active
- environment, and includes Pascal source code. The article hints at
- how to change the environment, and suggests creating paths longer
- than 128 characters as one application.
-
- In searching Simtel for source code, I found many possibilities. I
- liked PD1:<MSDOS.SYSUTL>RBSETNV1.ZIP of the ones I looked at (not
- all of them). It includes some utilities to manipulate the environ-
- ment, with source code in C.
-
- --
-
- Stan Brown, Oak Road Systems brown@Ncoast.ORG
-