#!/perl/bin/perl use strict; use warnings; use Win32::TieRegistry; my $host = shift || ''; my $hklm = $Registry->Connect($host, "HKEY_LOCAL_MACHINE", { Access => 'KEY_READ' } ) or die $^E; my $info = $hklm->{"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"}; my $ver = $info->{"CurrentVersion"}; my $sp = $info->{"CSDVersion"}; my $os = $hklm->{"SYSTEM\\CurrentControlSet\\Control\\ProductOptions\\ProductType"}; print "Remote OS: $os, Version: $ver, $sp\n";