Reference/EnumRegKey: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
mNo edit summary
 
Line 3: Line 3:
  user_var(output) root_key subkey index
  user_var(output) root_key subkey index


Set user variable $x with the name of the 'index'th registry key in root_key\Subkey. Valid values for root_key are listed under [[Reference/WriteRegStr|WriteRegStr]]. Returns an empty string if there are no more keys, and returns an empty string and sets the error flag if there is an error.
Set user variable $x with the name of the 'index'th registry key in root_key\Subkey. Valid values for root_key are listed under [[Reference/WriteRegExpandStr|WriteRegExpandStr]]. Returns an empty string if there are no more keys, and returns an empty string and sets the error flag if there is an error.


<highlight-nsis>StrCpy $0 0
<highlight-nsis>StrCpy $0 0

Latest revision as of 20:20, 27 February 2018

EnumRegKey

user_var(output) root_key subkey index

Set user variable $x with the name of the 'index'th registry key in root_key\Subkey. Valid values for root_key are listed under WriteRegExpandStr. Returns an empty string if there are no more keys, and returns an empty string and sets the error flag if there is an error.

StrCpy $0 0
loop:
  EnumRegKey $1 HKLM Software $0
  StrCmp $1 "" done
  IntOp $0 $0 + 1
  MessageBox MB_YESNO|MB_ICONQUESTION "$1$\n$\nMore?" IDYES loop
done:

Command introduced with NSIS v1.50