Search code examples
command-lineregistry

how to read registry values for the particular user


Do anyone have read the registry value for the particular user by using command prompt in windows? If anyone have read before by specify the user name please help me how may I get the value by using command-line command. Am trying to read the date and time format value from the registry but I getting different format for the different users.


Solution

  • If you know the users's SID you can query the registry for specific user settings. The following will get the sShortDate date format value for a user with SID: 123

    reg query "HKEY_USERS\123\Control Panel\International" /v sShortDate
    

    To get the SID for a specific user you can use wmic to get a list of name, sid pairs for all users of the system:

    wmic useraccount get name,sid