Article View: comp.os.msdos.programmer
Article #893Re: How can you set an environment variable in a program?
From: Stan Brown
Date: Wed, 26 Aug 1992 00:34
Date: Wed, 26 Aug 1992 00:34
25 lines
1701 bytes
1701 bytes
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
Technical Details
Message-ID:
<BtKExx.Jo0@NCoast.ORG>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ncoast!brownReferences:
<1345@rand.mel.cocam.oz.au> <690@aardvark.Rain.COM> <1992Aug24.143641.1@camins.camosun.bc.ca>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!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