1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
# Routine permettant d'obtenir de l'info sur le systeme
#
sub totmemphy {
#
use Win32::OLE qw(in with);
use Win32::Registry;
#
$WMI = Win32::OLE->new('WbemScripting.SWbemLocator') ||
erreur("Cannot access WMI on local machine: new "), Win32::OLE->LastError;
#
$Services = $WMI->ConnectServer($host) ||
erreur("Cannot access WMI on remote machine: connectserver "), Win32::OLE->LastError;
#
$os_set = $Services->InstancesOf("Win32_OperatingSystem");
foreach $os (in($os_set))
{
$sysexpl = $os->{'Caption'};
$version = $os->{'Version'};
}
$sys_set = $Services->InstancesOf("Win32_ComputerSystem");
foreach $sys (in($sys_set))
{
$totmem = $sys->{'TotalPhysicalMemory'} / 1024;
}
} |
Partager