Reputation: 11075
I'm using Java to get "USERDOMAIN" by
String domainname = System.getenv("USERDOMAIN");
System.out.println(domainname);
I can get the domain I want. However, I'm a little confused cause I can't find the "USERDOMAIN" under "System Properties --> Advanced --> Environment Variables". If it's not defined here, where is it defined? How can I know what Environment Variables I can get besides that listed on the Control Panel.
I have tested it on both win7 and win8. Thanks for your help in advance.
Upvotes: 0
Views: 362
Reputation: 201447
On the command line, type set
. Per the link, Type SET without parameters to display the current environment variables.
Upvotes: 2