All the answers I keep finding are for python 2.X, but I use python 3.X. They also keep talking about not working with .exe installed programs.
I need a way to be able to get a list of installed programs, both .exe and .msi (and any other method of installation as well), along side their respective installation paths.
At the moment, this is what I'm using to find things:
import os, string
from os.path import join, getsize
availableDrives = ['%s:' % d for d in string.ascii_uppercase if os.path.exists('%s:' % d)]
for i in range(len(availableDrives)):
for root, dirs, files in os.walk(availableDrives[i]):
print(root)
if "ds.py" in files:
print('yes')
else:
print("No")
For those that don't want to read it, it searches through all folder on every drive. I'm in the middle of making it slightly more fficient, but it is still time consuming and I was wondering if after 6 years (yes, that was when the questions were asked), theres finally a way to get this information?
If so, how? And if possible, could you give me the code for it but explain it as I need it as a small part of a school project.
Cheers all,
Luke
EDIT: I've seen some other resources using cmd to create a text file containing the necessary information. I wouldn't mid using this method if someone could tell me how to do it