home *** CD-ROM | disk | FTP | other *** search
- ; EnumKeys.KIX
- ;
- ; Enumerates a (registry) key and all its subkeys
- ;
- ;
- ; Note : This code sample is provided for demonstration purposes only.
- ; Microsoft makes no warranty, either express or implied,
- ; as to its usability in any given situation.
- ;
- BREAK ON
-
- IF $Key = 0
- $Key = "HKEY_CURRENT_USER\Printers"
- ENDIF
-
-
- ;
- ; first enumerate all subkeys of current key
- ;
- DIM $Index, $SaveKey
-
- $Index = 0
- $SubKey = EnumKey( $Key , $Index )
-
- WHILE @ERROR = 0
-
- $SaveKey = $Key
-
- $Key = $Key + "\" + $SubKey
-
- ? $Key
-
- CALL EnumKeys
-
- $Key = $SaveKey
- IF @ERROR = 0
-
- ; try for next subkey
-
- $Index = $Index + 1
- $SubKey = EnumKey( $Key , $Index )
- ENDIF
-
- LOOP
-
- ;
- ; Lastly, enumerate all values of current key
- ;
- $Index = 0
- $Value = EnumValue( $Key , $Index )
-
- WHILE @ERROR = 0
- ? $Key + "|" + $Value
- $Index = $Index + 1
- $Value = EnumValue( $Key , $Index )
- LOOP
-
- EXIT 0
-