> Shashank Date wrote:
> > # GetComputerName using Win32API
> > 
> > require 'Win32API'
> > 
> > def get_computer_name()
> 
> require 'socket'
> 
> p Socket.gethostname

Also:

  ENV["COMPUTERNAME"]

(Although that may not work across all Windows ... it should work NT/2k/XP)