If this problem has been previously reported, I apologize for the duplication, but I've searched through the forum and haven't found any
similar references to this problem. I've noticed recently that there seems to be a minor problem with the Get Registry Subkey command. I honestly don't know if this error popped up after the recent v8.5 update or if it has been a problem before that update.

To illustrate the problem, I'm going to use the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList registry key, which looks like
this:

- ProfileList
S-1-5-18
S-1-5-19
S-1-5-20
S-1-5-21-443186426-36040666280-3422536360-500
S-1-5-21-602162358-1060284298-1801674531-1406

Specifically, invoking the Get Registry Subkey command with a Subkey ID of "0" brings back correctly brings back a value of "5" since there
are 5 subkeys beneath the \ProfileList key. However, when you increment that Subkey ID by a value of 1, the next iteration of Get Registry Subkey does not bring back a value of "S-1-5-18" as it should -- it brings back a value of "S-1-5-19". For some reason, there doesn't seem to be a way to bring back the value of the first subkey beneath a key. The code I used is below and is actually almost identical to the example code in the Forum and also in the Reference manual for enumerating a registry key. I've already had one other SetupBuilder developer verify this, but I thought it should be submitted to the Forum for additional verification.


Set Variable %NUM_SUBKEYS% to FUNCTION:Get Registry SubKey("0") from "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"

Display Message Box "The number of subkeys = %NUM_SUBKEYS%" -- "Number of Subkeys"

Set Variable %LOOPCTR% to "0"

Loop (%NUM_SUBKEYS% Times)
Set Variable %LOOPCTR% to (Increment by 1)
Set Variable %WORK_SUBKEY% to FUNCTION:Get Registry SubKey("%LOOPCTR%") from "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
Display Message Box "This is loop iteration #%LOOPCTR%\nThe retrieved s..." -- "Loop iteration"
End