Good Morning,

I'm trying to delete a key on a remote computer. My account has admin privelages on the remote and local computer. They key does not have any sub-keys (it does have values). I am using kixtart 4.53 and the computers are a combination of w2k SP4 and xp SP2. When I try to delete the key, I get "The handle is invalid," error code 6. Here is a portion of the code ($strWks already has the name of the remote computer):

 Code:
$strProfReg = "\\" + $strWks + "\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
$arrProfs = ArrayEnumKey($strProfReg)
For Each $strProf In $arrProfs
   If Len($strProf) > 8
      $strSID = Right($strProf,Len($strProf)-InStrRev($strProf,"-"))
      If $strSID <> "500"
         $strPath = ExpandEnvironmentVars(ReadValue($strProfReg + "\" + $strProf,"ProfileImagePath"))
         DelDir($strPath)
         $intRetCode = DelKey($strProfReg + "\" + $strProf)
         ? @SERROR
         If $intRetCode <> 0
            ? "There was a problem deleting the registry key:"
            ? $strProfReg + "\" + $strProf
            ? "The error code is: " + $intRetCode
         EndIf
      EndIf
   EndIf
Next


There is some more code in there so that I am not deleting all the profiles. Everything else works fine, except when I try to delete the key.

Regards,

Brad V