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,