Microsoft KB Archive/90033

{| = PRB: Changing Environment Variable from Within FoxPro Fails =
 * width="100%"|

ID: Q90033

The information in this article applies to:


 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a
 * Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SYMPTOMS
When the RUN command is used to change an MS-DOS environment variable, the variable does not change to the new value.

CAUSE
When FoxPro starts, it creates a copy of the MS-DOS environment variables. These values cannot be changed in FoxPro because FoxPro loads a new copy of COMMAND.COM in order to process values specified in the RUN command. Any MS-DOS environment variables created or changed in this COMMAND.COM copy are valid only while that shell is running. Once the application specified in the RUN command completes its operations, the new variables or changes disappear.

RESOLUTION
Update or create MS-DOS environment variables outside FoxPro.

Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a GETENV KBCategory: kbprg kbprb KBSubcategory: FxprgGeneral
 * }