Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
As far as i know HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System registry node is not accessible for normal user. i needs admin rights to modify it.

i need source C#.net
Posted
Comments
Thanks7872 7-Jul-14 6:42am    
Don't repost question. You have already accepted solution at previous question. And don't ask for code,no one will provide you the code. We are here to help you with what you have tried.
[no name] 7-Jul-14 7:11am    
This is my code:
RegistryKey objRegistryKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");
objRegistryKey.SetValue("DisableTaskMgr", keyValue);
objRegistryKey.Close();
this code run in windows xp but dont run in windows 8....
Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system? If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
I know that the problem is the access level ....
What level do I have access to my code.
Richard MacCutchan 7-Jul-14 9:15am    
You need to run your program at Administrator level.

1 solution

You'll want to modify the manifest that gets embedded in the program. This works on VS2008 and higher: Project + Add New Item, select "Application Manifest File". Change the <requestedexecutionlevel> element to:
<requestedexecutionlevel level="requireAdministrator" uiaccess="false" />

The user gets the UAC prompt when they start the program. Use wisely, their patience can wear out quickly.

Get more info from following article
Requesting Admin Approval at Application Start[^]
 
Share this answer
 

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