home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / msdos / programm / 8813 < prev    next >
Encoding:
Text File  |  1992-08-25  |  1.6 KB  |  36 lines

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