locked
How to reference current logged on user's profile in the registry? RRS feed

  • Question

  • OK, I'm stumped here: 
       To tighted up security, mgmt has had us ditch mapped drives for links to paths, which show up in Windows Explorer nav. as Favorites. This works great, except in applications that use the PlacesBar. I've found several good resources for registry edits to have these links show up in the places bar, but they're String Values like: C:\Users\JShmoe\Links
    I'd like to set a GPO to set this, but I can't figure out how to make the setting applicable to the logged in user. I've found that I'll have to use an Expandable String Value, but trying every combination of %Username%, %USERPROFILE, yields nothing. I've tried C:\Users\%username%\Links, just %username%\Links, one %, two %, all uppercase and ...nada.    

        Any tips on how to reference the logged on user in the registry? 

    Thanks in advance!

    Friday, July 8, 2016 3:04 PM

Answers

All replies

  • Hi TACHC,

    A registry hive. The registry hive is the file NTuser.dat. The hive is loaded by the system at user logon, and it is mapped to the HKEY_CURRENT_USER registry key. The user's registry hive maintains the user's registry-based preferences and configuration.

    If you look at either of the following keys:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\ProfileList HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\hivelist

    You can find a list of the SIDs there with various values, including where their "home paths" which includes their usernames.

    The link below is about HKEY_CURRENT_USER.

    https://technet.microsoft.com/en-us/library/cc976337.aspx

    %USERNAME% will get you the username of the currently running process. I find a post is about how to find the current user for XP, although it does not support XP, we could try the command.

    http://stackoverflow.com/questions/1607271/how-do-you-find-the-current-user-in-a-windows-environment

    Please Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    Hope it will be helpful to you


    Please mark the reply as an answer if you find it is helpful.

    If you have feedback for TechNet Support, contact tnmff@microsoft.com

    • Proposed as answer by ZigZag3143x Monday, July 11, 2016 10:40 AM
    Monday, July 11, 2016 9:05 AM
  • Thanks Carl,

         Unfortunately, I'd already tried %USERNAME% and while (please see below screenshots), %USERNAME% works fine in Windows Explorer, it isn't usable for the PlacesBar. In fact, Windows doesn't seem to know what to show and no links are displayed when attempting to navigate through the "Open" dialog box....

    Lee

    Monday, July 11, 2016 1:15 PM
  • Hi TACHC,

    Thank you for the update on the issue. Please check the link below about identify currently loaded user Registry branch.

    http://superuser.com/questions/844532/remotely-identify-currently-loaded-user-registry-branch

    Please Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    Hope it will be helpful to you


    Please mark the reply as an answer if you find it is helpful.

    If you have feedback for TechNet Support, contact tnmff@microsoft.com

    Thursday, July 21, 2016 9:48 AM