PowerTip: Use PowerShell to Find User Profile Path

PowerTip: Use PowerShell to Find User Profile Path

  • Comments 2
  • Likes

Summary: Use Windows PowerShell to find the user profile path.

Hey, Scripting Guy! Question How can I easily get information about the folder and path to the profile for a currently signed-in user?

Hey, Scripting Guy! Answer Use the Env: PowerShell drive, and select the UserProfile environmental variable:

$env:USERPROFILE

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Thank you!

    I was trying to use 'UserName' (Like I had in the past), and it just appended my domain logon name to the path to my Desktop.

    C:\Users\first.last\flastxyz123\Desktop\...

    Like many organizations these days, your Logon Name and Profile/User name may be different.
    Like: first.last and flastxyz123
    Using '$Env:userprofile' gives the actual path to the desktop on the computer you are logged into.

    C:\Users\first.last\Desktop

    In my case I created a variable to dump a report file to my desktop every morning.
    $Destination = "$Env:userprofile\Desktop"