Skip to content
⌘ NSIS Forum Archive

delete registry key with wild card

5 posts

pkonduru#

delete registry key with wild card

Is it possible to do something like this in NSIS:

DeleteRegKey HKLM "SOFTWARE\Microsoft\MyProduct*"

I know the alternative is to do an Enum and find the correct registry key but was wondering if anyone got this working with a wildcard because supposedly something like this works :

DeleteRegKey HKLM "SOFTWARE\Microsoft\MyCompany\*"

removes all the registry keys under
SOFTWARE\Microsoft\MyCompany\

Thank you for your replies.
need9989#
# Registry query
nsExec::ExecToStack 'CMD /C "reg query "HKLM" /s /f "Enum" /k"' $0
pop $0
pop $1

#Remove the line break
${WordReplace} "$1" "$\r" "" "+" $1

### Then continue the query and delete it with the loop
Anders#
Originally Posted by need9989 View Post
nsExec::ExecToStack 'CMD /C "reg query "HKLM" /s /f "Enum" /k"' $0
pop $0
pop $1
You don't need nsExec, NSIS can enum registry keys and values with its registry instructions.