I have a logon script that imports a registry key. No big deal. This works.
My wish is to have the registry populate the current user logged on into that field.
So presently I have to manually edit the .reg file and input "domain\user" for each user in our department.
Is there a way to substitute "domain\user" for "%username%" that way the registry key is imported by User D and the registry key populates "domain\UserD" ?
Thank you for your input. Using Windows 7.
Best Answer
You can only use environmental values in REG_EXPAND_SZ
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724884(v=vs.85).aspx
Simliar question is on Super User.
https://superuser.com/questions/1158516/usage-of-username-in-registry