Find the explicit path of %USERPROFILE% in windows 7

5,013

Solution 1

If you're not looking for a python-specific answer, you can just open a command prompt and run echo %userprofile%.

Solution 2

Managed to do it using python:

import os
os.environ['USERPROFILE']
Share:
5,013

Related videos on Youtube

atomh33ls
Author by

atomh33ls

oo.computer shaperecords

Updated on September 18, 2022

Comments

  • atomh33ls
    atomh33ls over 1 year

    I am trying to find the current %USERPROFILE% path on windows 7.

    What is the simplest way to do this?

    I've tried hunting around with regedit


    N.b. I'm doing this as part of setting up a python virtual envionment on windows.

    • Dude named Ben
      Dude named Ben over 7 years
    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 over 7 years
      echo %userprofile% in a command prompt doesn't suffice?
    • atomh33ls
      atomh33ls over 7 years
      @DudenamedBen Thanks yes - came to the same answer independently in the end..
    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 over 7 years
      I put it in, but you can accept it or your own answer. Whatever floats your boat. ;)