Created
December 15, 2017 03:20
-
-
Save grepsedawk/8d2bb32374513b92377b35d6ce03f3e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 -tt | |
from winreg import * | |
def software_path(program_key): | |
key = OpenKey(ConnectRegistry(None, HKEY_LOCAL_MACHINE), f'SOFTWARE\{program_key}') | |
for i in range(QueryInfoKey(key)[1]): | |
try: | |
subkey = EnumValue(key, i) | |
if subkey[0] == '': | |
return subkey[1] | |
except EnvironmentError: | |
# handle not found case here | |
return False | |
print(software_path('VideoLAN\VLC')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment