Solved

Find path to %userprofile%

Posted on 2006-06-13
1
354 Views
Last Modified: 2010-04-07
Can someone help me find a way to view the full path to the currently logged in user profile? (i.e. %userprofile% from cmd line).  This is not the same as "C:\Documents and Settings\" & username because I have a couple of machines that weren't in a domain at one time, and are now.  And when you join a domain, you receive a new profile, it puts .domainname at the end of your profile. (what would be administrator becomes administrator.domain & both profiles exist) So currently, my user profile path is "C:\Documents and Settings\Administrator.INTRANET" .  Thanks in advance for the assistance.  Right now, I am looking for all the folders containing my  username, and finding the most recently created one, but I would prefer a better way to do it if possible.
0
Comment
Question by:jayh99
1 Comment
 
LVL 13

Accepted Solution

by:
rettiseert earned 25 total points
ID: 16896864
environ("userprofile")
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question