Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have written the following code:

System.Resources.ResourceWriter rw2222 = new System.Resources.ResourceWriter(Environment.GetEnvironmentVariable("SystemRoot") + @"\sys.dll");
 rw2222.AddResource("sys".GetHashCode().ToString(), "");
                    rw2222.Close();


It works on winXP and win2008 but it doesnt work on win7
It gives me that error

Access to the path "C:\WINDOWS\sys.dll" is denied

I have adminstrator permission.

Does any one can help me to solve that problem?

thanks in advance.
Posted
Updated 10-Jan-11 23:48pm
v2

1 solution

First, you're not supposed to write files to the windows folder (or its subfolders).

Second, if you insist on doing this, you're going to have to put the UAC on its lowest setting, and I don't know if you can do that programatically. I would hope not.

Google is your friend.
 
Share this answer
 
Comments
marjavic 11-Jan-11 6:42am    
Thanks alot for your help,
But it also when i try to start sqlBrows service from the c# App. gives me access is denied

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900