473,385 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Change a value in registry (hklm/system) as user

Hey Huys, I developed and simply application that just change a key in the
HKLM/System . Its a correction of a software we use here. We put it to run in
the login of all users, but the users that do not have adminstrator
privileges, the software cannot change the key in the registry. I would like
to know if is there a way of run my application as another user... but
automatically...not using "run as.." option, machine by machine...

Thanks..
André.
--
André.
Dec 7 '05 #1
1 1090
"Maximus-br" <Ma*******@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
Hey Huys, I developed and simply application that just change a key in the
HKLM/System . Its a correction of a software we use here. We put it to run
in
the login of all users, but the users that do not have adminstrator
privileges, the software cannot change the key in the registry. I would
like
to know if is there a way of run my application as another user... but
automatically...not using "run as.." option, machine by machine...


Do all the machines have the same password for an account with
administrative privileges?

If so, on XP, you can use the sequence

LogonUser();
ImpersonateLoggedOnUser();

// do what you gotta do here

RevertToSelf();

to make the changes in the context of the more privileged account.

Prior to XP, the function LogonUser() required the SE_TCB_NAME privilege
which is typically granted only to administrators so it is not an option
there. You can use SSPI to accomplish the same thing albeit with quite a lot
more work. The technique is described here:

http://support.microsoft.com/?kbid=180548

Regards,
Will
Dec 7 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: René Beumer | last post by:
I am trying to install a windows service written in .net 2003 on my Windows 2000 computer. I have followed the walkthru given in msdn but the service fails to install with 'requested registry...
2
by: Eranga | last post by:
Is there any way that we can serach for a registry key value with a known data. For example if I want to find a registry value with the known data"InternetSearch" how can I do it on C#? for any...
11
by: Josh Flanagan | last post by:
I am trying to write to the event log from ASP.NET, on Windows XP SP1. As soon as I try to write an event (or even query the source with EventLog.SourceExists() or EventLog.LogNameFromSourceName())...
0
by: tmsprowl | last post by:
Greetings! I was wondering if someone could help me with a problem I'm having. My department is just one of many within my organization. My organization has control over the network domain,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.