473,387 Members | 1,669 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,387 software developers and data experts.

Registry Writing

I have a simple tool that I create that stores some settings in the
Registry... however, if the user running it doesn't have Admin priveleges on
the machine, the app fails when trying to write to the registry. I know
there are applications out there that can read/write to the registry w/o
Admin priveleges... is there some way to code around this in C#.NET? I.e.,
to have the program run the registry code in a different security context
somehow, or something?

Thx,
MS
Sep 12 '06 #1
3 2264
MS,

No, they can not write to the registry if they do not have permissions.
It is possible that these tools might impersonate a user that has
permissions, but you would have to know the credentials of a user that has
permissions for the registry.

Keep your program as it is, and don't allow writing to the registry if
the user doesn't have permissions. There is a reason that there are
permissions on the registry in the first place, you know?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sreppohcdoow" <Sr**********@asdf.comwrote in message
news:uV**************@TK2MSFTNGP05.phx.gbl...
>I have a simple tool that I create that stores some settings in the
Registry... however, if the user running it doesn't have Admin priveleges
on the machine, the app fails when trying to write to the registry. I know
there are applications out there that can read/write to the registry w/o
Admin priveleges... is there some way to code around this in C#.NET? I.e.,
to have the program run the registry code in a different security context
somehow, or something?

Thx,
MS


Sep 12 '06 #2
>I have a simple tool that I create that stores some settings in the
>Registry... however, if the user running it doesn't have Admin priveleges
on the machine, the app fails when trying to write to the registry. I know
there are applications out there that can read/write to the registry w/o
Admin priveleges... is there some way to code around this in C#.NET? I.e.,
to have the program run the registry code in a different security context
somehow, or something?
Are these per-user settings? If so then they should be under
HKEY_CURRENT_USER which each user has full rights to by default. Otherwise
follow Nicholas' advice.
Sep 12 '06 #3
ah, good point... i was using HKLM instead of HKCU. doh!
"Bob Chambers" <no_spam@_nospam.comwrote in message
news:uC**************@TK2MSFTNGP05.phx.gbl...
I have a simple tool that I create that stores some settings in the
Registry... however, if the user running it doesn't have Admin priveleges
on the machine, the app fails when trying to write to the registry. I
know there are applications out there that can read/write to the registry
w/o Admin priveleges... is there some way to code around this in C#.NET?
I.e., to have the program run the registry code in a different security
context somehow, or something?

Are these per-user settings? If so then they should be under
HKEY_CURRENT_USER which each user has full rights to by default. Otherwise
follow Nicholas' advice.

Sep 12 '06 #4

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

Similar topics

3
by: Rohit Santhanam | last post by:
As I am reading the .NET documentation, I get the feeling that Microsoft is trying to get rid of the registry. My understanding is that an application built using .NET does not use the registry...
0
by: glenn | last post by:
I am trying to write to the registry and the objects that are suppose to be handling this function are not working. Here is what is happening. I am issuing the following commands: RegistryKey...
2
by: glenn | last post by:
I am trying to write to the registry and the objects that are suppose to be handling this function are not working. Here is what is happening. I am issuing the following commands: RegistryKey...
2
by: LCD | last post by:
Here is what I want to do: Presently in my registry I have: (Default) = "C:\Program Files\myApp" and this value is scattered all over registry in several keys and subkeys. I wouldlike to...
5
by: UJ | last post by:
I have a system that has five programs that all communicate with each other via Message Queues. Works well. One program is a watchdog that will make sure the others are up and going. Currently I...
1
by: Chris Mullins | last post by:
I need to write to the 32-bit registry, and need to do so from a 64-bit MSI. It never occurred to me that this would be difficult... I have an application that installs some 64-bit binaries for...
14
by: Newbie Coder | last post by:
Hi all, VB.NET 2003 ONLY PLEASE I have a registry key (HKCU\Software\Newbie\SomeKey) of type string which holds an XML string as follows: <root formID="preferencesform" lang="english" ...
1
by: projectVBA | last post by:
Hi , I wrote some add in for PowerPoint and i'm trying to find an automatic way to load it every time PowerPoint starts. I found Microsoft Code example (see below ) BUT the problem is : I can't...
2
by: J.K. Baltzersen | last post by:
Dear all, I have a counter in my Windows registry. Is there any way of ensuring that it is updated by one process/thread at a time only. One way of updating is retrieving the counter,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.