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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With