0

Example:

 Private Sub remKey(ByRef RegKey As String)
    Try
        Registry.LocalMachine.DeleteSubKey(RegKey, True)
    Catch ex As Exception

            End Try

If I run this as admin, it works with no problem using remKey("blahblah") The issue I'm having is I need to be able to remove registry keys from the CurrentUser section of the registry, I need to be able to get to their keys as well.

Every time I run it as admin, being that I'm remoted in to another computer it tries to view the currentuser for the admin profile currently in the registry.

Any thoughts?

ShawnB
  • 25
  • 6
  • Try CurrentUser instead of LocalMachine – SomeNickName Jan 18 '14 at 17:48
  • Would that still work being that the application is launched as a separate admin account? Like say my admin username is AdminName, and I need to get to UserName's current user regkeys.. Would this still work if the application is launched with my credentials? because it's requiring admin to get to the localmachine keys. registry.currentuser.deletesubkey returns with my admin account's registry keys. – ShawnB Jan 18 '14 at 17:51
  • Well no, currentuser ofc as it tells it's the current user that's currently being "used" (with an active session). I never done what you're trying to but perhaps [this](http://superuser.com/questions/46399/tool-to-access-another-users-registry-hkey-current-user) can help? – SomeNickName Jan 18 '14 at 18:05
  • Unfortunately I don't think it's going to be possible unless I can spawn some sort of process from the admin(d) application and run it as current user to remove the CurrentUser keys. Though.. I'm not sure how complex that will be. Also, thanks for the reply. You're always the first one who comments on my posts. :D – ShawnB Jan 18 '14 at 19:18
  • I never done that, but i also found [this](http://stackoverflow.com/questions/6564153/edit-registry-key-of-other-user) Unfortunately i can't help you personally cause i never had to do that :/ – SomeNickName Jan 18 '14 at 19:24

0 Answers0