Click to See Complete Forum and Search --> : What is better for program path detection?


mwpeck
May 29th, 2008, 10:22 PM
HKEY_LOCAL_MACHINE

or

HKEY_USERS?

I have seen another programmer using HKEY_USERS, but I personally, and have seen others, using HKEY_LOCAL_MACHINE, just wondering if one is better to use than the other or if its all just programmer preference.

As for usage, just simple program install path lookup.

TheCPUWizard
May 29th, 2008, 10:25 PM
It depends. If the intent is that it is for ALL users of that machine, then LOCAL_MACHINE, it it is customizable per user USER.

As a note, NO programs being written today should EVER directly access the registry. You will have major headaches with Vista/Server2008 and it will become (most likely) totally non-functional in vNext.

Use the proper API's for getting this information.

mwpeck
May 29th, 2008, 10:34 PM
"Use the proper API's..." Which would be?

I have my own little program which reads a registry value as read-only, I run Vista64 with all the security features enabled as of what a standard install enables.....it has no problems reading the value I want it to.

TheCPUWizard
May 29th, 2008, 10:57 PM
Here is a starting point....

http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=9060486