Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.os.msdos.programmer FAQ part 4/5
Section - - How can a program set DOS environment variables?

( Part1 - Part2 - Part3 - Part4 - Part5 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Houses ]


Top Document: comp.os.msdos.programmer FAQ part 4/5
Previous Document: - How can I find the error level of the previous program?
Next Document: - How can I change the switch character to - from /?
See reader questions & answers on this topic! - Help others by sharing your knowledge

 Program functions that read or write "the environment" typically access
 only the program's copy of it. 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 depends on the version of DOS.

 A fairly well-written article in PC Magazine 28 Nov 1989 (viii:20),
 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.

 Now as for downloadable source code, there are many possibilities.

 Stan Brown, the former list maintainer recommends the following:
 <ftp://garbo.uwasa.fi/pc/envutil/>

 It includes some utilities to manipulate the environment, with source
 code in C. A newer program from PC Magazine 22 Dec 1992 (XI: 22) is:
 <ftp://garbo.uwasa.fi/pc/pcmagvol/>

 You can also use a call to INT 2E, Pass Command to Interpreter for
 Execution; see Ralf Brown's interrupt list (<Q:02.03> [What and where is
 Ralf Brown's interrupt list?]) for details and cautions.

 Reader Dr. John Stockton has written a unit for Turbo Pascal known as
 jrs_envu.pas to facilitate writing to the environment. It is for DOS
 (not DPMI) mode programs running under DOS to Win98, but not WinNT. It
 can be downloaded from here:
 <http://www.merlyn.demon.co.uk/programs/jrs_envu.pas>. For more
 information, see <http://www.merlyn.demon.co.uk/batprogs.htm>.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: comp.os.msdos.programmer FAQ part 4/5
Previous Document: - How can I find the error level of the previous program?
Next Document: - How can I change the switch character to - from /?

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
jeffrey@carlyle.org (Jeffrey Carlyle)





Last Update March 27 2014 @ 02:11 PM