Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8460703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:40:52+00:00 2026-06-10T13:40:52+00:00

I am trying to resolve %USERPROFILE% using WScript.Shell . When I create a vbs

  • 0

I am trying to resolve %USERPROFILE% using WScript.Shell. When I create a vbs file and run directly from Windows, I get the correct path for the logged-in user C:\Documents and Settings\Administrator but it gets resolved to C:\Documents and Settings\Default User 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

var oShell = new ActiveXObject("Wscript.Shell");
var userPath = oShell.ExpandEnvironmentStrings("%USERPROFILE%");

Is there a permission/setting which I need to check to get correct value of USERPROFILE when retrieving value from the webapp?

PS: I am using javascript to code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:40:54+00:00Added an answer on June 10, 2026 at 1:40 pm

    ASP does not know what user is logged in, it runs under a generic anonymous internet user account.

    If you want IIS to know the current user, you will have to remove rights for the anonymous user on the directory of your site. This will force IIS to show your users a login screen.
    After they log in, the thread for that session will run under the logged on user (so make sure that user has rights). You can now use request.servervariables(“AUTH_USER”) to get the username.

    Erik

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to resolve a hostname from an ip address. I have tried using
I'm trying to resolve correct paths to javascript scripts in my head section using:
I'm trying to create a patch for cf.vim to resolve an issue with hashes.
I'm trying to resolve a reflection warning in Clojure that seems to result from
Im trying to resolve an issue where when using NHibernate with a SqlServerCeDriver that
I am trying to resolve a TimeSpan using Unity . Executing the container Resolve
I'm building legacy code using the GNUARM C compiler and trying to resolve all
I am using JSF 2. I am trying to resolve a message bundle reference
I'm trying to set up pik on my windows machine. In the .pikrc file,
In trying to resolve the issue I was having for: managing website on windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.