Microsoft KB Archive/217111

= PRB: Calling getenv in COM Objects Does Not Work Under Active Server Pages =

Article ID: 217111

Article Last Modified on 7/14/2004

-

APPLIES TO


 * Microsoft Active Server Pages 4.0, when used with:
 * Microsoft Internet Information Services 5.0
 * Microsoft Internet Information Server 4.0
 * Microsoft Internet Information Services 5.0

-



This article was previously published under Q217111



SYMPTOMS
When calling a method of a COM component that uses the getenv function, the function returns a NULL value for the environment variable passed to it as parameter.



CAUSE
The environment variable passed to getenv is a user environment variable. Calling getenv under Active Server Pages (ASP) can access only the system environment block.



RESOLUTION
Add the environment variable to the system environment block if you need to retrieve the variable from ASP.


 * 1) Right-click on the My Computer icon on the desktop.
 * 2) Click Properties.
 * 3) In the System Properties dialog box, click the Environment tab.
 * 4) Select an item from the System variables list.
 * 5) Enter the variable name in the Variable text box.
 * 6) Enter the value of the variable in the Value text box.
 * 7) Click Set.



STATUS
This behavior is by design.

Keywords: kbsecurity kbprb KB217111

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.