$include "Registry.inc" file MyFile openfile(MyFile,getstartpath + "AserviceList.txt","W") 'Key to be enumerated - CHANGE THIS TO A VALID REGISTRY KEY OF YOUR CHOICE examkey = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services" OPENCONSOLE PRINT PRINT "Key to enumerated = ",examkey PRINT 'Count the number of sub keys ret = RegCountSubKeys(examkey) PRINT "Number of sub-keys = ", ret PRINT int x,y 'Enumerate sub keys FOR x = 0 to (ret-1) retval = RegEnumKey(examkey,x) PRINT "Sub-key ",(x+1), retval examkey = examkey + "\\" + retval 'PRINT 'PRINT "Press any key to list registry entries for ",examkey 'do:until inkey$ <> "" 'cls 'Count the number of values (entries) for the key "HKEY_CURRENT_USER\\Software\\KMS" PRINT values = RegCountEntries(examkey) PRINT values,"entries for ",examkey PRINT 'Enumerate the entry names string SType = "" SType = RegGetValue(examkey,"Type") SType = ltrim$(SType) if SType = "16" or SType = "32" and values > 0 'write MyFile,"Sub Key Name " + examkey int z,a,b a = 0 b = 0 for z = 1 to len(examkey) string chr chr = mid$(examkey,z,1) if chr = chr$(92) a ++ b = z endif next z 'write MyFile," BackSlash No = " + str$(a) + " at pos " + str$(b) write MyFile," Service Name = " + mid$(examkey,b+1,len(examkey)) write MyFile," ================================================================== " FOR y = 0 to (values-1) retval = RegEnumEntryName(examkey,y) PRINT examkey," entry ",(y+1), retval if retval <> "FailureActions" 'Display the type - string,dword etc showtype = RegGetEntryType(examkey,retval) IF showtype = 1 'PRINT "The entry '",retval,"' is a String" ENDIF IF showtype = 4 'PRINT "The entry '",retval,"' is a Dword" ENDIF 'Display the stored value of the entry resultin = RegGetValue(examkey,retval) write MyFile," " + retval + " : " + resultin PRINT "Value is ",resultin PRINT endif NEXT y write MyFile," ================================================================== " write MyFile," " endif label NextSubKey examkey = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services" next x 'Finish PRINT "Press any key to finish." DO:UNTIL INKEY$ <> "" closefile MyFile END