Delete registry all sub keys only

Microsoft Office professional 2010 softw...
September 20, 2013 at 01:04:23
Specs: Windows 8, 4G
Hi

I am trying to delete all sub keys within a sub key with a .reg file but not sure how, I can enter a "-" symbol in front of the registry, but I don't know what it is after the key, I just wanted to delete all the sub keys. Any ideas as I have tried wile card "*" at the end but it didn't work.

eg: HKLM\software\Microsoft\WindowsNT\Current Version\Print\Provider\.......

Delete all sub keys after provider but leave Provider .

Thanks

message edited by kiwi_hk


See More: Delete registry all sub keys only

Report •


#1
September 20, 2013 at 07:31:30
You can create a REG-File like this:

--SNIP--

Windows Registry Editor Version 5.00

[-HKLM\software\Microsoft\WindowsNT\Current Version\Print\Provider\Something]


--SNIP--

save the file and doubleclick on it.
It will delete Something and all it's subkeys.
The last given key, in this case, Something, will also be deletet.

message edited by paulsep


Report •

#2
September 21, 2013 at 22:31:43
I did but I want to leave the something and only delete the subkeys, this will delete the whole something key.

Report •

#3
September 22, 2013 at 06:43:29
The easiest way would be to use one of the better Window's native scripting environments. Powershell, for instance:
Get-ChildItem "HKLM:\software\Microsoft\Windows NT\CurrentVersion\Print\Provider" | 
  Where-Object { $_.PSIsContainer }  | Remove-Item -Force -Recurse

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
September 23, 2013 at 18:57:28
Doesn't seem to work.

Full path is: in windows 8 pro
HKLM:\software\Microsoft\Windows NT\CurrentVersion\Print\Provider\Client Side Rendering Print Provider\
All the sub keys beginning with s-1-5-21-1114458861-928070724-2076119496-*
and
HKLM:\software\Microsoft\Windows NT\CurrentVersion\Print\Provider\Client Side Rendering Print Provider\Servers\pserver\printers\
all subkeys inside there.

Thanks

Please help


Report •

#5
October 10, 2013 at 13:11:53
Correct me, if I'm wrong, but I guess, the colon is not correct for registry keys path.

Report •

#6
October 10, 2013 at 18:36:34
kiwi_hk make sure you're running your script from an elevated PowerShell script.

paulsep: PowerShell shows the HKLM key as a drive, and drives are named by having a colon after the drive's name.

How To Ask Questions The Smart Way


Report •

#7
October 10, 2013 at 19:37:18
I am not sure how to do it.

I started powershell in admin mode

Type in: Get-ChildItem "HKLM:\software\Microsoft\Windows NT\CurrentVersion\Print\Provider\client side rendering print provider\" | Where-Object { $_.PSIsContainer } | Remove-Item -Force -Recurse

It just gives me an error when I press enter.

How to I just remove all subkeys starting with s-1-5-21-1114458861-928070724-2076119496-* under the Cleint side rendering print provider?

Thankls


Report •

Ask Question