-5

I need to delete some local machine registry keys, I tried all registry delete routines but the result is through admin account I cant do it. how can I set access rights of my application to system account using windows API routines??? I also used this routine RegDeleteKey but returned value 5 means access denied, I run my application under full admin rights

even manually open regedit with admin rights, I wont be able to delete local machine registry keys. for purpose I need system account rights.

i opened regedit with system account rights and i was able to delete local machine keys successfully. now i need to do this programmatically

AnasShoaib90
  • 629
  • 2
  • 7
  • 14
  • 2
    You've just rushed this question without taking time to ask it well. Hence downvotes. Please spend time explaining all the missing details. Don't ask the question in comments to answers. The more time you spend asking a good question, the better the answers. – David Heffernan Apr 23 '15 at 07:19

1 Answers1

4

You either need to run your application as an administrator (Run as administrator in the context menu of Explorer), or you need to add a manifest to your application, indicating that your application needs administrator rights. In the latter case, a UAC dialog will ask you for administrator credentials.

R. Beiboer
  • 712
  • 9
  • 21