views:

60

answers:

1

Does this code win32api.GetUserName() works fine on all win system from win 2000 to win 7 ? What about if user is not local user but domain user, does it still work ?

When i use this function shell.SHGetFolderPath(0, shellcon.CSIDL_someDirectory, 0, 0), do I get wanted folder for currently logged user ?

Any help appreciated.

+1  A: 

There is a module called getpass which has a getpass.getuser() function. This should work on all windows versions. It did on all the versions I've tried anyway. The user I've used wasn't local either.

Mattias Nilsson