Hi,
I have an app that I need to set some values in the CurrentUser and
LocalMachine of the Registry. If the user has administrator previledges, no
problems occur. However, if the user if of type "limited" or
non-administrator, I receive an exception when trying to write in the
LocalMachine.
How can I bypass or impersonate the administrator to enable the app to write
values in the LocalMachine.
Thanks again,
RF 2 4378
Why don't you set the permissions on the key instead. "Bypassing" certainly
won't work, and impersonating an administrator is probably a bad idea.
--
Klaus H. Probst, MVP http://www.vbbox.com/
"RF" <ra*******@SPAM dialexia.com> wrote in message
news:ei******** ******@tk2msftn gp13.phx.gbl... Hi,
I have an app that I need to set some values in the CurrentUser and LocalMachine of the Registry. If the user has administrator previledges,
no problems occur. However, if the user if of type "limited" or non-administrator, I receive an exception when trying to write in the LocalMachine.
How can I bypass or impersonate the administrator to enable the app to
write values in the LocalMachine.
Thanks again,
RF
You have to request permission to write
System.Security .Permissions.Re gistryPermissio n permission = new
System.Security .Permissions.Re gistryPermissio n(
System.Security .Permissions.Re gistryPermissio nAccess.AllAcce ss,@"HKEY_LOCAL _
MACHINE\Softwar e\MySoftware\My Key");
permission.Dema nd();
--
Shak
(Houston)
"RF" <ra*******@SPAM dialexia.com> wrote in message
news:ei******** ******@tk2msftn gp13.phx.gbl... Hi,
I have an app that I need to set some values in the CurrentUser and LocalMachine of the Registry. If the user has administrator previledges,
no problems occur. However, if the user if of type "limited" or non-administrator, I receive an exception when trying to write in the LocalMachine.
How can I bypass or impersonate the administrator to enable the app to
write values in the LocalMachine.
Thanks again,
RF
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Test Test |
last post by:
Hi, group!
Here is some interesting problem:
Our company has developed a large VB6 application that runs very smoothly on
most environments.
However, all of a sudden one of our customers (unsing WinNT SP6) experienced
a dramatic
performance drop. We investigated, and it turned out that it depends on the
|
by: MFS 43 |
last post by:
Using Access 2000 and 2002
Have set up user-level security with a new .mdw file (secured.mdw).
I open my database with a short cut whose target includes a command line option
for the workgroup .mdw file. This seems to work for the user-level security.
However, if I go directly (through Explorer) to the Access .mdb file of my
program (Program.mdb) and double click to start this .mdb file, the program
opens without any security!!
|
by: Dennis C. Drumm |
last post by:
Can my program access the HKEY_LOCAL_MACHINE/Software section of the
registry when being used by a user with restricted rights (not with admin
rights)?
If so, how? I have a program that functions just fine when run by an
administrator but generates an exception when run by a restricted user. The
program accesses the HKEY_LOCAL_MACHINE/Software section to set or get
application settings that are not user specific.
Thanks,
|
by: KarlM |
last post by:
I would like to write to the EventLog (Application) with following code. But
this works only under admin account. There are no restrictions in the
WriteEntry-documentation.
Can anyone help me?
Thanks in advance!
try
{
|
by: Stephan Leppin |
last post by:
I've got a general question.
Is it possible to change Registry of a registry Path by a procedure call or
something like that in .NET.
| |
by: Jay |
last post by:
Hey There,
I was able to change the access rights to a file through adding an
ACE to the DACL of a file. I have two questions that I am still trying
to get resolved regarding this:
1). When I reboot the machine, the Access Rights go back to the
previous settings, how do I get the modified Access Rights to stick
across reboots?
2). Also, is this information kept in the registry? If so, where in
the registry is it kept?
|
by: sebapi |
last post by:
Hello!
I create some keys in registry and I want to each user has full rights
to this keys.
So I use AddAccessRule like:
RegistrySecurity rs = new RegistrySecurity();
rs.AddAccessRule(new RegistryAccessRule("Users",
RegistryRights.FullControl, InheritanceFlags.None,
PropagationFlags.None, AccessControlType.Allow));
key = Registry.LocalMachine.CreateSubKey(someKey,
|
by: buzzluck68 |
last post by:
Hello,
I have an in house application that we developed, but everyone who
needs to use the program are not allowed to be local admins on their
PCs. I was wondering if there was a way to code the application to
not require admin rights (for modifying/creating excel and text files
as well as modifying the registry)?
And I was wondering if there was a way around needing admin rights for
creating a setup package for the program?
|
by: Steve |
last post by:
Hi All
I have several vb.net 2005 apps which have run fine until now
A new customer has set up windows XP with restricted users
When my application starts I get errors, when accessing the registry etc,
due to insufficent rights for the user
If I create a keyfile and set my app to full trust in project settings, many
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |