Solved

writing to registry tat affects ALL users

Posted on 2003-12-02
18
277 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
Comment Utility
try writing them to
HKey_USERS/.Default

0
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
How about HKEY_LOCAL_MACHINE

-brian
0
 

Author Comment

by:java_kevin
Comment Utility
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
Comment Utility
Create a new key under


HKEY_LOCAL_MACHINE\Software\YourApp


It will see from all user
0
 

Author Comment

by:java_kevin
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 26

Expert Comment

by:EDDYKT
Comment Utility
>>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
Comment Utility
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
Comment Utility
The use never logon to that machine.

ie

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

Author Comment

by:java_kevin
Comment Utility
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
Comment Utility
>>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
Comment Utility
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
Comment Utility
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
Comment Utility
By the way, for services exe, can values be written to the registry?
0
 
LVL 29

Expert Comment

by:leonstryker
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now