Eugene
Eugene

Reputation: 11075

Why can I get Environment Variable that isn't defined in the Control Panel

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

Answers (1)

Elliott Frisch
Elliott Frisch

Reputation: 201447

On the command line, type set. Per the link, Type SET without parameters to display the current environment variables.

Upvotes: 2

Related Questions