Unable to resolve user environment variable correctly

Cpt Dave

New Member
I am trying to resolve \[code\]%USERPROFILE%\[/code\] using \[code\]WScript.Shell\[/code\]. When I create a vbs file and run directly from Windows, I get the correct path for the logged-in user \[code\]C:\Documents and Settings\Administrator\[/code\] but it gets resolved to \[code\]C:\Documents and Settings\Default User\[/code\] instead of logged-in user when I used it inside my classic ASP webapp running on the local machine on IIS. The code I used is as below\[code\]var oShell = new ActiveXObject("Wscript.Shell");var userPath = oShell.ExpandEnvironmentStrings("%USERPROFILE%");\[/code\]Is there a permission/setting which I need to check to get correct value of \[code\]USERPROFILE\[/code\] when retrieving value from the webapp?PS: I am using javascript to code.
 
Back
Top