MCPcopy Create free account
hub / github.com/geekcomputers/Python / sid2user

Function sid2user

recyclebin.py:20–30  ·  view source on GitHub ↗
(sid)

Source from the content-addressed store, hash-verified

18
19
20def 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
33def returnDir(): # Start of the function to search through the recyclebin

Callers 1

findRecycledFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected