It would appear that MS has broken remotely running REG DELETE. From Windows 2008 R2 SP1 running REG DELETE against WinXP SP3 remotely fails. For example:
C:\>REG DELETE "\\PCNAME\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers" /FERROR: The procedure number is out of range.
Running that REG DELETE command physically on WinXP still works. Running the command from XP to XP remotely also works.
Looking around on Google there doesn't appear to be much about this error except a few posts:
* http://social.msdn.microsoft.com/Forums/vstudio/en-US/c1d73bfc-ab61-4e35-8f9b-8456f1ca66fd/registrykeydeletesubkey-failed-with-the-procedure-number-is-out-of-range
hints that its an implementation issue in advapi32.dll and a known issue (but no linked proof).
* http://connect.microsoft.com/PowerShell/feedback/details/693279/poshv3ctp1-error-the-procedure-number-is-out-of-range-while-deleting-registry-key
Using PowerShell, which is what I was originally trying to do with PSRR Remove-RegKey has the same issue too. Under the covers it actually uses Microsoft.Win32.RegistryHive.DeleteSubKeyTree which exhibits the same problem.
PS C:\> Remove-RegKey -ComputerName PCNAME -Hive LocalMachine -Key "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers" -Recurse -Force -verboseVERBOSE: Enter process block...VERBOSE: Starting remote registry connection against: [PCNAME].VERBOSE: Registry Hive is: [LocalMachine].VERBOSE: Opening RemoteBaseKey using the 'Default' RegistryViewVERBOSE: Parameter [Force] or [Confirm:$False] is presnet, suppressing confirmations.VERBOSE: Setting value name: []VERBOSE: Parameter [Recurse] is presnet, deleting key and sub items.Remove-RegKey : Exception calling "DeleteSubKeyTree" with "1" argument(s): "The procedure number is out of range."At line:1 char:1+ Remove-RegKey -ComputerName PCNAME -Hive LocalMachine -Key "SOFTWARE\Microso ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Remove-RegKey VERBOSE: Exit process block...
Anyone have any thoughts on what MS exactly broke? Yes, I've already implemented a work around to accomplish the same end goal.
--
If it's not on Google, then it doesn't exist.**DC++ FAQ**
↧