finding system information/environment using Java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package keyboardreader; // my package
/**
*
* @author vijay
* http://javamix.wordpress.com
*/
import java.util.*;
import javax.swing.*;
import java.awt.*;
public class SystemEnvironmentlook
{
private final static JTextArea output = new JTextArea();
public static void main( String args[] )
{
initGUI();
Map env = System.getenv();
Iterator iter = env.keySet().iterator();
while ( iter.hasNext() )
{
String key = iter.next();
output( String.format(“%s >>>> %s\n”, key, env.get(key)) );
}
System.out.println( “\n\n” );
}
public static void output( String str )
{
System.out.print( str );
output.append( str );
}
public static void initGUI()
{
output.setForeground( Color.WHITE );
output.setBackground( new Color(60,52,90) );
JFrame f = new JFrame( “System Environment -JavaMix” );
f.add( new JScrollPane(output), BorderLayout.CENTER );
f.setSize( 640, 700 );
f.setVisible( true );
}
}
OUTPUT:
USERPROFILE >>>> C:\Documents and Settings\vijay
PATHEXT >>>> .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
SystemDrive >>>> C:
TEMP >>>> C:\DOCUME~1\vijay\LOCALS~1\Temp
ProgramFiles >>>> C:\Program Files
Path >>>> C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.6.0_03\bin;C:\Documents and Settings\vijay\Desktop\final Data\Remote compiler\RemoteCompiler\build\classes\remotecompiler
HOMEDRIVE >>>> C:
PROCESSOR_REVISION >>>> 0f02
CLIENTNAME >>>> Console
USERDOMAIN >>>> UTS-SYSTEM09
ALLUSERSPROFILE >>>> C:\Documents and Settings\All Users
PROCESSOR_IDENTIFIER >>>> x86 Family 6 Model 15 Stepping 2, GenuineIntel
SESSIONNAME >>>> Console
TMP >>>> C:\DOCUME~1\vijay\LOCALS~1\Temp
LOGONSERVER >>>> \\UTS-SYSTEM09
CommonProgramFiles >>>> C:\Program Files\Common Files
=:: >>>> ::\
PROCESSOR_ARCHITECTURE >>>> x86
OS >>>> Windows_NT
FP_NO_HOST_CHECK >>>> NO
HOMEPATH >>>> \Documents and Settings\vijay
PROCESSOR_LEVEL >>>> 6
COMPUTERNAME >>>> UTS-SYSTEM09
windir >>>> C:\WINDOWS
SystemRoot >>>> C:\WINDOWS
NUMBER_OF_PROCESSORS >>>> 2
USERNAME >>>> vijay
ComSpec >>>> C:\WINDOWS\system32\cmd.exe
APPDATA >>>> C:\Documents and Settings\vijay\Application Data
note: this is not my program, iam just copied and edited & i don`t have any rights on this program any one can copy,edit.

