No your code is correct. I think this is actually a BUG

Simply using DelTree works just fine.


 Code:
Dim $strWks, $strProfReg, $intRetCode, $AK
$strWks = ""
While Not $strWks
   ? "Please enter the name of the workstation from which you wish to delete the key?"
   Gets $strWks
Loop
$strWks = Trim($strWks)
$strProfReg = "\\" + $strWks + "\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\testme"
'Profile is: ' + $strProfReg ?
$AK = AddKey($strProfReg)
'Error: ' + @ERROR + ' - ' + @SERROR ?
If @ERROR = 0
   ? "The key was added.  Now try to delete it."
   $intRetCode = DelTree($strProfReg)
   If @ERROR = 0
      ? "The key was deleted."
   Else
      ? "The key was not deleted.  The error code is: " + $intRetCode
      ? "The error message is: " + @SERROR
   EndIf
Else
   ? "The key was not written."
EndIf