File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes java & System Properties Regarding.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "java & System Properties Regarding.. " Watch "java & System Properties Regarding.. " New topic

java & System Properties Regarding..

Jack Daniel
Ranch Hand

Joined: Jun 15, 2002
Posts: 163
Hi all..

well, i have got a question...

with the following code:

It gets the USER account name...
(1) how and from where does java interpreter get this???
(2) Will it be equal to the (say) Windows Log-in name, OR it is got from the System and will not be read from Windows Log on;

just wanted to figure out, because if it is the windows log in name, then at some applications, i can prevent the user from logging and by default use the windows-login name, to identify the user..

Otherwise, Is there a way to read Windows log on name, from java??

it will be great if u guys help me on this..
appreciate your help..
thx ;-)
Scott Dunbar
Ranch Hand

Joined: Sep 23, 2004
Posts: 245
Yes, it is retrieved from the underlying O/S. As long as you control the program you should be ok. However, there is nothing from stoping something like:

C:\scott> java Props is "scottd"

C:\scott>java Props is "blah"

So be careful with who can change the startup script.

<a href="" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Jack Daniel
Ranch Hand

Joined: Jun 15, 2002
Posts: 163
Thanks scott..

so you mean to say it is read from the O/S (maybe say from some Registry key).. but it will not be the same as the O/S log in? (which sometimes will be different, say a public system, where different users log in.. )

plz clarify.. thanks again..
I agree. Here's the link:
subject: java & System Properties Regarding..
It's not a secret anymore!