- 0
Find and delete registry keys/values
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
VBScript on Windows is on the way out, here is what to do with your legacy VBA projects
By Usama Jawad96,
- 8 replies
- 0 views
-
Microsoft may disable VBScript early in Windows 11 24H2 25H2, shares detailed official guide
By hellowalkman,
- microsoft
- windows 11
- (and 8 more)
- 13 replies
- 0 views
-
- 8 replies
- 7 views
-
Every Windows 10 and 11 feature Microsoft deprecated in 2023
By TarasBuria,
- microsoft
- windows 11
- (and 20 more)
- 11 replies
- 12 views
-
Microsoft has officially deprecated the VBScript language from future Windows versions
By John Callaham,
- microsoft
- microsoft windows
- (and 3 more)
- 24 replies
- 2 views
-
Question
Daedroth
Hi. I'm not too brilliant with VBScript, so please bear with me. I'm trying to create a script to search for xyz value in the registry and delete it from a target machine.
I'd like the process to be:
Box to input xyz
Box to input target machine name
Scan target registry and delete the value, keep scanning until all are deleted.
Report how many deleted or report if none found.
Is this possible?
So far I have:
Set WshShell = WScript.CreateObject("WScript.Shell")
Set DelReg = GetObject ("WinMgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv")
'Constants for WMI StdRegProv
Const HKCU = &H80000001
Const HKLM = &H80000002
Const HK_USERS = &H80000003
'On Error Resume Next
sStartKeyPath = "" 'Sets the search to start from the root of the registry
Do while regkey = ""
regkey = InputBox("What would you like to search the registry for?")
if regkey = "" then
msgbox "Please enter search criteria."
End if
Loop
DelReg.DeleteValue regkey[/CODE]
At the moment I can't even get it to search and delete a key from my own machine.
Link to comment
https://www.neowin.net/forum/topic/1150082-find-and-delete-registry-keysvalues/Share on other sites
4 answers to this question
Recommended Posts