I guess that would help! :) On Jan 12, 2008 11:50 PM, Guilherme Polo <[EMAIL PROTECTED]> wrote: > > 2008/1/12, Giampaolo Rodola' <[EMAIL PROTECTED]>: > > 2008/1/12, Guilherme Polo <[EMAIL PROTECTED]>: > > > 2008/1/12, Giampaolo Rodola' <[EMAIL PROTECTED]>: > > > > 2008/1/12, Giampaolo Rodola' <[EMAIL PROTECTED]>: > > > > > 2008/1/12, Guilherme Polo <[EMAIL PROTECTED]>: > > > > > > 2008/1/12, Giampaolo Rodola' <[EMAIL PROTECTED]>: > > > > > > > Hi, > > > > > > > I'm trying to use the pywin32 extension to find out the users > > > > > > > home directories. > > > > > > > Currently I found a way for doing that but it requires to > > > > > > > validate the > > > > > > > user by providing its username + password: > > > > > > > > > > > > > > def get_homedir(username, password): > > > > > > > token = win32security.LogonUser( > > > > > > > username, > > > > > > > None, > > > > > > > password, > > > > > > > win32security.LOGON32_LOGON_NETWORK, > > > > > > > win32security.LOGON32_PROVIDER_DEFAULT > > > > > > > ) > > > > > > > return win32profile.GetUserProfileDirectory(token) > > > > > > > > > > > > > > > > > > > > > What I'd like to do is avoiding the requirement of the password, > > > > > > > in > > > > > > > the same way as if I would on UNIX where it would be enough just > > > > > > > using > > > > > > > the pwd module and providing the username only: > > > > > > > > > > > > > > >>> import pwd > > > > > > > >>> pwd.getpwnam('user').pw_dir > > > > > > > '/home/user' > > > > > > > > > > > > > > Does someone know if it is possible to do that? > > > > > > > > > > > > Did you try: > > > > > > > > > > > > import os > > > > > > os.path.expanduser('~user') > > > > > > > > > > > > > It doesn't seem to be what I'm searching for: > > > > > > > > >>> os.path.expanduser('~') > > > > 'C:\\Documents and Settings\\billiejoex' > > > > >>> os.path.expanduser('~user') > > > > '~user' > > > > >>> > > > > > > Does user 'user' actually exists ? > > > > Yes. > > Look also those ones: > > > > >>> os.path.expanduser('~Administrator') > > '~Administrator' > > >>> os.path.expanduser('~Guest') > > '~Guest' > > >>> > > > > Uhm.. my bad then, I should use windows before posting on pywin32. > > -- > -- Guilherme H. Polo Goncalves > > _______________________________________________ > python-win32 mailing list > python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 >
-- http://search.goldwatches.com/?Search=Movado+Watches http://www.jewelerslounge.com http://www.goldwatches.com _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32