Skip to main content
added 1 character in body
Source Link
ncica
  • 7.2k
  • 1
  • 19
  • 41

These might work. I don't know how they behave when running as a service. They aren't portable, but that's what "os.name"os.name and "if" statementsifstatements are for.

win32api.GetUserName()

win32api.GetUserNameEx(...)

win32api.GetUserName() win32api.GetUserNameEx(...) 

See: http://timgolden.me.uk/python/win32_how_do_i/get-the-owner-of-a-file.html

These might work. I don't know how they behave when running as a service. They aren't portable, but that's what "os.name" and "if" statements are for.

win32api.GetUserName()

win32api.GetUserNameEx(...)

See: http://timgolden.me.uk/python/win32_how_do_i/get-the-owner-of-a-file.html

These might work. I don't know how they behave when running as a service. They aren't portable, but that's what os.name and ifstatements are for.

win32api.GetUserName() win32api.GetUserNameEx(...) 

See: http://timgolden.me.uk/python/win32_how_do_i/get-the-owner-of-a-file.html

Source Link
Adam
  • 348
  • 3
  • 3

These might work. I don't know how they behave when running as a service. They aren't portable, but that's what "os.name" and "if" statements are for.

win32api.GetUserName()

win32api.GetUserNameEx(...)

See: http://timgolden.me.uk/python/win32_how_do_i/get-the-owner-of-a-file.html