Link to home
Start Free TrialLog in
Avatar of G Chow
G Chow

asked on

Powershell commands to search HKU

I have a question where i need to write a script which can search the following hives and delete any String value names which match my criteria.

i need to be able to search the entire HKU hive and HKLM

Example, i need to delete any key name that would be called "Malware A" and another one called "Malware B"
They tend to be listed under these directories below but if theres a way to search the entire registry that would be great

HKU\S-1-5-18\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN
HKU\S-1-5-21-1172670090-1033165640-4219323903-500\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN
HKLM\SOFTWARE\WOW6432NODE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN

I would prefer to be able to launch the script easily via CMD if possible open powershell via CMD
Avatar of Lasse Bodilsen
Lasse Bodilsen
Flag of Denmark image

Avatar of G Chow
G Chow

ASKER

Thanks but viewed that already it doesn't show how to store the keys and delete them as requested, its just a basic search command.
ASKER CERTIFIED SOLUTION
Avatar of Lasse Bodilsen
Lasse Bodilsen
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Even if the OP have not confirmed it to work, i still think this is the best solution to solve the original problem.