Solved

Reading registry key from HKCU and not hklm

Posted on 2016-10-18
10
164 Views
Last Modified: 2016-11-03
Hello.
We have a program, which is access by various users using remote desktop, and a program which uses hklm for storing custom settings. Each time one user mąkę changes to their settings,  they are populated to all users. Is there any way (registry tool for example) that could force this program to use HKCU instead?
0
Comment
Question by:Rafał Kowalski
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
10 Comments
 
LVL 28

Assisted Solution

by:Dr. Klahn
Dr. Klahn earned 125 total points
ID: 41849493
Question:  Is the program in question a commercial product, which is already compiled, and you do not have the source to it?

If that is the case, the answer is no.  The name of the key is compiled into the program.  A change such as this requires changing the source program and recompiling it.
0
 
LVL 62

Assisted Solution

by:☠ MASQ ☠
☠ MASQ ☠ earned 125 total points
ID: 41849497
It's unlikely as where the registry is written to depends on the programming.
Assume you have no support from the publisher. Is it written for multiple users?  
Also because your users are using RDP the remote machine is running as a single user so this would be expected behaviour.  The program "thinks" that single user keeps changing their mind about how the settings should be stored.
0
 
LVL 34

Expert Comment

by:sarabande
ID: 41849562
you may try the following:

copy key and all entries to hkcu. then rename the key in hklm.

reboot and check what happened.

it is a chance that the program detects where it gets its registry data from and after that worked correctly.

Sara
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 28

Expert Comment

by:Dr. Klahn
ID: 41870272
The comments by myself and Masqueraid directly address the question, "Is it possible to ..."?

The answer is, "No, it is not, under these circumstances."

The fact that it is not possible to do X does not mean that the comments have no merit.  The question should be closed with points so that the answers can remain available for future similar cases.
0
 
LVL 62

Expert Comment

by:☠ MASQ ☠
ID: 41870692
Sara, normally I'd agree with that disposition but I'm not aware of any software that has a failback to HKCU if the search at HKLM fails - if you can show an example I'm happy to go with the delete otherwise I'd agree with Dr. Klahn's summary that this time the correct answer is "You can't do that".

Can we sit it in the RA queue for arbitration?
0
 
LVL 34

Accepted Solution

by:
sarabande earned 250 total points
ID: 41871000
>> I'm not aware of any software that has a failback to HKCU if the search at HKLM fails

I know many applications which have  a fallback to HKLM if access to HKCU failed. The other direction is indeed somewhat strange.

I am a Windows programmer since 1990 if I remember rightly. We used win.ini file and later own Inifiles which were located with the application and later in a data folder.  After 2000 MS mapped Inifiles to the registry, see

https://support.microsoft.com/en-us/kb/102889

The Default Path was \HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\IniFileMapping

With the Profile API the Developers could add options to their entries to change the default behavior, for example by specifying

>>      USR: - This prefix stands for HKEY_CURRENT_USER, and the text after the prefix is relative to that key.

Even Visual Studio itself changed their Settings from HKLM to HKCU in VS.NET because many Users run VS with no admin rights and couldn't change important options (like new Active-X Add-Ons) after that (even today I run VS 2010 'as Administrator or some of my batch scripts would fail to install 3rd-Party components to the registry). I don't know whether they do a fallback to HKLM now, but I am pretty sure they did in the early 2000 years.

Anyway, if an application used HKLM settings, these settings only could be changed by an Admin User. In the original post we had the information, that the application runs at a server machine and the Clients are using Remote Desktop. Is it likely that all Users have local admin rights at the Server? Perhaps. If that is true, it also it might be possible, that the application stores their variables in HKLM and only there. It could even be that this is an intended behavior to prevent non-Admin Users from changing the settings. It also could be that the application still was maintained and that it was possible to get the issue changed.

We didn't get an answer from the Asker (not even now) and therefore all this is pure speculation.

>> Can we sit it in the RA queue for arbitration?

Of course. Moderators please decide at your convenience.

Sara
0
 
LVL 62

Expert Comment

by:☠ MASQ ☠
ID: 41871001
Thanks Sara,  that history usefully describes why HKCU can failback to HKLM but, because of the registry heirarchy, won't work the other way around. It also adds value to this thread and is point worthy in itself.

Not sure why the thread has defaulted back to 4 day delete, so just resetting so the RA can get picked up on.
0

Featured Post

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question