dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
1601

USR56K
join:2000-05-20
Lynnwood, WA

1 edit

USR56K

Member

REG DELETE fails "The procedure number is out of range"

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" /F
ERROR: 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 -verbose
VERBOSE: Enter process block...
VERBOSE: Starting remote registry connection against: [PCNAME].
VERBOSE: Registry Hive is: [LocalMachine].
VERBOSE: Opening RemoteBaseKey using the 'Default' RegistryView
VERBOSE: 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.
dave
Premium Member
join:2000-05-04
not in ohio

dave

Premium Member

Re: REG DELETE fails "The procedure number is out of range&

said by USR56K:

Anyone have any thoughts on what MS exactly broke?

If it's the same problem as reported by the first link: the newer version of the REG command uses a procedure that does not exist on the older OS.

»msdn.microsoft.com/en-us ··· 85).aspx