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.
delete registry key with wild card
5 posts
No, there is no wildcard support for that in NSIS nor Windows.
Thanks Anders!
# 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
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
You don't need nsExec, NSIS can enum registry keys and values with its registry instructions.Originally Posted by need9989 View PostnsExec::ExecToStack 'CMD /C "reg query "HKLM" /s /f "Enum" /k"' $0
pop $0
pop $1