Solved

writing to registry tat affects ALL users

Posted on 2003-12-02
18
281 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
[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
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

752 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