/build/static/layout/Breadcrumb_cap_w.png

Find And Delete Registry Keys From Every User Profile

'-- Script To Delete Registry Key From All User Profiles in Windows XP

On Error Resume Next

Const HKEY_USERS = &H80000003

strComputer = "."

strKeyPath = ""

Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKey="Software\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}"

DeleteSubkeys HKEY_USERS, strKeypath

strKey="Software\Microsoft\Active Setup\Installed Components\{44BBA842-CC51-11CF-AAFA-00AA00B6015B}"

DeleteSubkeys HKEY_USERS, strKeypath

Sub DeleteSubkeys(HKEY_USERS, strKeyPath)

objRegistry.EnumKey HKEY_USERS, strKeyPath, arrSubkeys

If IsArray(arrSubkeys) Then

For Each strSubkey In arrSubkeys

DeleteSubkeys HKEY_USERS, strKeyPath & strSubkey & "\" & strKey

objRegistry.DeleteKey HKEY_USERS, strKeyPath & strSubkey & "\" & strKey

Next

End If

objRegistry.DeleteKey HKEY_USERS, strKeyPath & strSubkey & "\" & strKey

End Sub


Comments

  • If you have a chance could you explain why you're defining strKey twice and what each is doing. I'm looking for some assistance on looking at a particular reg key in every user profile and deleting it if it exists. I believe this is exactly what I need but just curious why you have two different keys defined. Thanks! - cubspsycho85 12 years ago
  • abcvd - Vbscripter 6 years ago
This post is locked
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ