(sid)
| 18 | |
| 19 | |
| 20 | def sid2user(sid): # Start of the function to gather the user |
| 21 | try: |
| 22 | key = OpenKey( |
| 23 | HKEY_LOCAL_MACHINE, |
| 24 | r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" + "\\" + sid, |
| 25 | ) |
| 26 | (value, type) = QueryValueEx(key, "ProfileImagePath") |
| 27 | user = value.split("\\")[-1] |
| 28 | return user |
| 29 | except Exception: |
| 30 | return sid |
| 31 | |
| 32 | |
| 33 | def returnDir(): # Start of the function to search through the recyclebin |