Microsoft KB Archive/96209

{|
 * width="100%"|

INFO: Chaining Parent PSP Environment Variables

 * }

Q96209

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * the operating system: Microsoft Windows NT, versions 3.1, 3.5, 3.51, 4.0
 * the operating system: Microsoft Windows 2000

-

SUMMARY
Some MS-DOS-based applications change the environment variables of their parent application by chaining through the program segment prefix (PSP). With Windows NT, this functionality doesn't work if the parent is a Win32-based application.

MORE INFORMATION
When an MS-DOS-based application is started from a single command shell (SCS), the application inherits a new copy of the environment variables. Any attempts by the MS-DOS-based application to modify its parent's environment variables will not work. When the MS-DOS-based application exits, the SCS will be &quot;restored&quot; to its original state. If another MS-DOS-based application is started, the second application will receive the same environment that the first MS-DOS-based application received.

If an MS-DOS-based application (B) is spawned by another MS-DOS-based application (A), any modifications to application A's environment variables will be reflected when application B exits.

For more information on how environment variables are set, please see the following article(s) in the Microsoft Knowledge Base:

"Q100843 Environment Variables in Windows NT" Additional query words: 3.10 3.50

Keywords : kb16bitonly kbnokeyword kbKernBase kbOSWinNT310 kbOSWinNT350 kbOSWinNT351 kbOSWinNT400 kbOSWin2000 kbDSupport kbGrpDSKernBase

Issue type : kbinfo

Technology : kbAudDeveloper kbWin32sSearch kbWin32API