Solved

writing to registry tat affects ALL users

Posted on 2003-12-02
18
278 Views
Last Modified: 2010-05-03
Hi,
I have a piece of coding that edits the registry in such way that it disables the taskmanager, shutdown and logging off features of the system. These are all saved under HKCU.

However, I realise that if another user logs in, the edited registry values will be gone. But the registry values remain for the previous user. Is there anywhere to write the values so that it will affect all the users instead of the current one?

thanks!
0
Comment
Question by:java_kevin
18 Comments
 
LVL 39

Expert Comment

by:appari
ID: 9856514
try writing them to
HKey_USERS/.Default

0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 9857079
How about HKEY_LOCAL_MACHINE

-brian
0
 

Author Comment

by:java_kevin
ID: 9857388
appari, I tried to put the values inside /default as you suggested. But it was not recognised by the system at all.

brian, local machine doesn't provide this feature.

thanks guys..
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9857678
Create a new key under


HKEY_LOCAL_MACHINE\Software\YourApp


It will see from all user
0
 

Author Comment

by:java_kevin
ID: 9857787
eddkyt, yup, creating values under HKLM will make it work for all users, howeever, the code tat i'm using affects the way Windows work. Thus, it has to be from HKCU.

As mentioned, I'm disabling shutdown, logoff and taskmanager.
0
 
LVL 26

Accepted Solution

by:
EDDYKT earned 125 total points
ID: 9858032
HKCU is only affect the current user

HKey_USERS will affect all user except the user already created.

If you create a new user then it will works
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9858042
You can writeinto hkey_local_machine to store your configuration and your app will update hkcu according when the user login
0
 

Author Comment

by:java_kevin
ID: 9858173
edd, under HK_users, i did create a key like i did in HKCU. But the effect is not there. It only works in current user... unless u mean, i create in users, and try logging in from other accounts... I'll try right now...
0
 

Author Comment

by:java_kevin
ID: 9858343
edd, i created the nologoff key in default, and logged in as another user. but it did not work.

I know you mean that i can edit the HKCU... but... i'm having a BIG problem with it.

But it doesn't.... relate to this question.. but nevermind, I'll just vent my frustration here.

my program is supposed to disable those functions mentioned above. when it starts up, they are disabled. However i need to convert it to a NT service. So I use firedaemon to do it.

I am not sure if firedaemon doesn't support writing to registry or what, but whenever it starts my program, my program does not write to the registry at all.

So, I made my program this way. when the program is first installed, it'll write to the registry to disable those features and these will be permanent. but, then it was realised later that HKCU only affect the current user, and does not affect other people who log in. So I'm having a headache trying to get out of this situation...

i'm gonna try some other program to convert mine into service and hope they help...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 26

Expert Comment

by:EDDYKT
ID: 9858420
>>edd, i created the nologoff key in default, and logged in as another user. but it did not work.


HKey_USERS will onlt copy to user as long as the user never logon onto the system


ie, the user name never appears on system/profile directory
0
 

Author Comment

by:java_kevin
ID: 9858471
umm... what does your 2nd line imply? default will only be affected if no user logged on? in win2k and XP, tha'ts not possible to not login right?
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9858541
The use never logon to that machine.

ie

user name never appears on "Documents and Settings" directory
0
 

Author Comment

by:java_kevin
ID: 9858630
ok... so, for win2k/XP, HKuser will only be useful  if no one logins.

right now, i'm still having problem writing to the registry if the program is a service. Is this true that, services are not able to write to registry?
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9858740
>>ok... so, for win2k/XP, HKuser will only be useful  if no one logins.


not true. hkuser will copy to HKCU if the user never been login that machine
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9858752
System user should be able to write to registry. System is super user on local machine. However, If no yuser login in. HKCU registry key will not exist
0
 

Author Comment

by:java_kevin
ID: 9858836
hkuser will copy to HKCU if the user never been login that machine

>> i don't get you.. so what's the purpose?

how do i know if it's system user? For firedaemon, it's not known. for the other software i'm trying, it say's it's system account. But it does not write to registry as well.

I rebooted, with it supposed to load up, but it doesn't affect teh registry.

I ran my program, and the registry changed.
0
 

Author Comment

by:java_kevin
ID: 9873197
By the way, for services exe, can values be written to the registry?
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 10211874
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered EDDYKT
 
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

leonstryker
EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

919 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now