Re: How To retrieve the full user name, in Vista??



On 27 Dec, 23:33, Roedy Green <see_webs...@xxxxxxxxxxxxxxxxxxxx>
wrote:
On Fri, 28 Dec 2007 00:15:55 +0100, Jan Burse <janbu...@xxxxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :

Dear All

With the following code:

System.getProperty("user.name");

I can retrieven the user name. But this is
not the full name that is for example displayed
in the login screen and in the start menu by
Windows Vista.

Is there some library call to retrieve
the full name in JDK 1.6+?

Best Regards

if you don't get a better answer, find out how to do it is C++ and
write some JNI. I had to do this to get the Windows-specific VolSer.

Seehttp://mindprod.com/products1.html#VOLSER

What the OP is asking for is inherently non-portable so no solution is
going to be completely clean. The way I would do it is write a little
C program that returns the username, then invoke it from script that
runs the java program. The script can pass this value as a java
property which is picked up via System.getProperty. I did something
similar for a program I have that needs to know the UNIX pid, which
also cannot be obtained in a portable way.

Regards,

Andrew Marlow

.



Relevant Pages

  • Re: Check for a Windows Program
    ... I invoke this C++ app from my java program like this ... Is there a way I can check if my C++ program is up and running from my java program which invoked it. ... //executing the script takes almost no time, but the C++ program evoked by the script takes some time ...
    (comp.lang.java.programmer)
  • Are sysctl(8) values useful for measuring system resource consumption?
    ... the "developer experience," what resources are thus consumed, and figure ... script that essentailly acts as a bit of "scaffolding" around time; ... the script sets things up to invoke timewith the "-l" flag (so we ...
    (freebsd-performance)
  • Re: [Full-disclosure] SSH brute force blocking tool
    ... And just what on God's earth does "SOMEONE LOGGING IN WITH USERNAME SET ... TO A VALID PASSWORD ENTRY" have to do with this script. ... the classic attack is the symlink attack. ...
    (Full-Disclosure)
  • PHP Access Script (free guide)
    ... he keys in his username and password ... in this case, if John Davis correctly log in, the script ... kick out the user. ... Browser agent to act as an invisible session ID. ...
    (alt.php)
  • Running a script in Windows2000 Server
    ... I am running Windows 2000 server from which this scrip t needs to be run. ... batch file I write a shuttdown.exe file I am recieving a (Loading script ... dim conn, rs, strsql, username, dbline, flag, errdesc ...
    (microsoft.public.windows.server.scripting)