#!C:/Perl/bin/perl.exe -w use Config; use strict; print "\nOS name: ".$Config{'osname'}; print "\nOS archname: ".$Config{'archname'}; print "\nOS version: ".$Config{'osvers'}; #### #!C:/Perl/bin/perl.exe -w use Win32::OLE qw(in with); $host = "127.0.0.1"; $WMI = Win32::OLE->new('WbemScripting.SWbemLocator') || die "Cannot access WMI on local machine: ", Win32::OLE->LastError; $Services = $WMI->ConnectServer($host) || die "Cannot access WMI on remote machine: ", Win32::OLE->LastError; $os_set = $Services->InstancesOf("Win32_OperatingSystem"); foreach $os (in($os_set)) { $os_name = $os->{'Caption'}; } print "$os_name\n";