in reply to win32 get login name
will do what you want. For more detailed information, you can also use this snippet from Learning Perl on Win32 Systems (co-authored by our own merlyn):use Win32; $login = Win32::LoginName;
HTH,use Win32::NetAdmin; $user = Win32::LoginName; # grab the name of the current user Win32::NetAdmin::UserGetAttributes("", $username, $password, $passwordage, $privilege, $homedir, $comment, $flags, $scriptpath); print "The homedir for $username is $homedir\n";
--Jim
Update: Glad it works for you, although cut/paste may have caused you to drop a semicolon after your "my $profile" statement, but otherwise works for me!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: win32 get login name
by softworkz (Monk) on Jan 10, 2002 at 01:46 UTC |