rich2323 Posted August 1, 2012 Posted August 1, 2012 I am trying to remotely remove a HKU registry key. I can delete values in the same branch, but can't delete the actual key. I also can delete the key if I use the registry editor (connecting remotely) Here is an example of the registry key exported: Windows Registry Editor Version 5.00 [HKEY_USERS\S-1-5-21-1400463981-1064451746-3237261625-5047\Software\Act\OutlookAddressBooks] [HKEY_USERS\S-1-5-21-1400463981-1064451746-3237261625-5047\Software\Act\OutlookAddressBooks\2] "padFile"="" "Password"="F180D8541454E04F8C1EC942F86A588B" "User"="" Here is the code I use to delete "padFile" from OutlookAddressBooks\2 $delete = RegDelete ("\\192.168.16.101\HKU\S-1-5-21-1400463981-1064451746-3237261625-5047\Software\Act\OutlookAddressBooks\2","PadFile") This code works correctly and deletes the value. Here is the code I am trying to use to delete OutlookAddressBooks\2: $delete = RegDelete ("\\192.168.16.101\HKU\S-1-5-21-1400463981-1064451746-3237261625-5047\Software\Act\OutlookAddressBooks\2") When I run this code I get a return code of "2" and an @error code of "-2" and an extended error code of "1745" Am I doing something wrong in my code? Is there a better way to delete this remotely? Thanks for your help, Rich
Tripredacus Posted August 2, 2012 Posted August 2, 2012 Let's look at that error: RPC_S_PROCNUM_OUT_OF_RANGEhttp://msdn.microsoft.com/en-us/library/cc245518%28v=prot.13%29.aspxSimilar problem with C#:http://stackoverflow.com/questions/6779803/c-sharp-cant-delete-certificate-from-remote-machineConcerning some different type of function, a normal behaviour for something or other says this:Windows NT 4.0 SP3 does not support this method and returns 0x000006D1 (RPC_S_PROCNUM_OUT_OF_RANGE).Which leads me to believe that the method you are using is not supported by the OS you are trying it on.... such as XP...Look at this thread on Social:http://social.msdn.microsoft.com/Forums/en/netfxbcl/thread/c1d73bfc-ab61-4e35-8f9b-8456f1ca66fd Twitter | MSFN | VGCollect
rich2323 Posted August 5, 2012 Author Posted August 5, 2012 Thanks Triprdacus, I was banging my head on this one and could not figure it out. I'll start working on plan B. I really appreciate that you help explain why it does not work, rather than just leaving it hanging out there. It’s nice to have closure. Rich
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now