Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- installedSoftware = []
- for key in reg:
- try:
- count = 0 # int variable for iterating through registry keys
- while True:
- subKeyName = EnumKey(key, count) # name of registry key at given index
- isKB = subKeyName.find('KB') # check if string contains KB number (-1 if not)
- if isKB != -1:
- keySplit = subKeyName.split('_') # split key name at underscores
- for s in keySplit:
- if 'KB' in s:
- installedSoftware.append(s) # add substring to list if it contains a KB number
- count += 1
- except WindowsError:
- pass
- kbNumbers = set(installedSoftware)
Add Comment
Please, Sign In to add comment