Howto determine file owner on windows using python without pywin32

前端 未结 3 1052
别跟我提以往
别跟我提以往 2020-12-06 13:17

I am writing a script which needs to determine the username of the owner of files on windows.

While I found a solution using pywin32 but I am hesitant to use it, as

3条回答
  •  攒了一身酷
    2020-12-06 13:42

    You could invoke a windows shell command "dir /q" and parse the output to find owners.

    subprocess.call("dir /q", shell=True)
    

提交回复
热议问题