Is it possible for an Java application that running on the Windows NT workstation to get the computer name and the user name of the machine it is running on?

Naveed Azhar

I think you can do it using the following approach:
1- Make a batch ( lets say GETWINDIR.BAT ) with the contents :

echo %COMPUTERNAME% > windlocation.txt 
echo %USERNAME% > windlocation.txt 
2- Run this file using Runtime.exec("GETWINDIR.BAT") function from your java program.
3- Use Standard file classes to get the contents of "windlocation.txt"