It may have something else utility in windows?I am ready even to write such a tool myself and call it from python. but I have no idea how to get this information? tell me how to crash problem in any programming language? I believe that in C/С++ or C# code is a matter of the 5-lines with the output to the console ... if so - what will be glad to help, and then I will cause this utility from python推荐答案 python 2.7尝试使用win32security库中的功能(GetFileSecurity和LookupAccountSid),您将获得有关所有者的信息try to use the functions (GetFileSecurity and LookupAccountSid) from the win32security library and you will obtain information about ownerimport win32securitydef GetOwner(filename): f = win32security.GetFileSecurity(filename, win32security.OWNER_SECURITY_INFORMATION) (username, domain, sid_name_use) = win32security.LookupAccountSid(None, f.GetSecurityDescriptorOwner()) return usernameprint GetOwner(r"\\some_shared_location\somefile.txt") 这篇关于如何在Windows 7中获取文件的所有者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-18 05:45