use Win32::OLE qw(in with);
use Win32::Registry;
# Pick a host that you have the necessary rights to monitor
$host = "PutHereTheHostsDomainName";
# Gather System Information
$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;
# Gather Computer System Information
$sys_set = $Services->InstancesOf("Win32_ComputerSystem");
foreach $sys (in($sys_set))
{
$system_name = $sys->{'Caption'};
$system_type = $sys->{'SystemType'};
$system_manufacturer = $sys->{'Manufacturer'};
$system_model = $sys->{'Model'};
}
# Gather Processor Information
$processor_set = $Services->InstancesOf("Win32_Processor");
foreach $proc (in($processor_set))
{
$proc_description = $proc->{'Caption'};
$proc_manufacturer = $proc->{'Manufacturer'};
$proc_mhz = $proc->{'CurrentClockSpeed'};
}
# Gather BIOS Information
$bios_set = $Services->InstancesOf("Win32_BIOS");
foreach $bios (in($bios_set))
{
$bios_info = $bios->{'Version'};
}
# Gather Time Zone Information
$loc_set = $Services->InstancesOf("Win32_TimeZone");
foreach $loc (in($loc_set))
{
$loc_timezone = $loc->{'StandardName'};
}
# Gather Operating System Information
$os_set = $Services->InstancesOf("Win32_OperatingSystem");
foreach $os (in($os_set))
{
$os_name = $os->{'Caption'};
$os_version = $os->{'Version'};
$os_manufacturer = $os->{'Manufacturer'};
$os_build = $os->{'BuildNumber'};
$os_directory = $os->{'WindowsDirectory'};
$os_locale = $os->{'Locale'};
$os_totalmem = $os->{'TotalVisibleMemorySize'};
$os_freemem = $os->{'FreePhysicalMemory'};
$os_totalvirtmem = $os->{'TotalVirtualMemorySize'};
$os_freevirtmem = $os->{'FreeVirtualMemory'};
$os_pagefilesize = $os->{'SizeStoredInPagingFiles'};
}
# Now convert the system's Locale to a string
# Use the Rfc1766 Database stored in the Registry as a lookup table
$main::HKEY_LOCAL_MACHINE->Open("SOFTWARE\\Classes\\MIME\\Database\\Rfc1766",$Rfc1766);
$Rfc1766->GetValues(\%Values);
foreach $key (keys %Values)
{
$key = $Values{$key};
if ($$key[0] eq $os_locale)
{
($lang, $country) = split(/\;/, $$key[2]);
last;
}
}
print "System Summary Information\n";
print "--------------------------\n";
print "OS Name\t\t\t\t$os_name\n";
print "Version\t\t\t\t$os_version Build $os_build\n";
print "OS Manufacturer\t\t\t$os_manufacturer\n";
print "System Name\t\t\t$system_name\n";
print "System Manufacturer\t\t$system_manufacturer\n";
print "System Model\t\t\t$system_model\n";
print "System Type\t\t\t$system_type\n";
print "Processor\t\t\t$proc_description $proc_manufacturer ~$proc_mhz Mhz\n";
print "BIOS Version\t\t\t$bios_info\n";
print "Windows Directory\t\t$os_directory\n";
print "Locale\t\t\t\t$country\n";
print "Time Zone\t\t\t$loc_timezone\n";
print "Total Physical Memory\t\t$os_totalmem KB\n";
print "Available Physical Memory\t$os_freemem KB \n";
print "Total Virtual Memory\t\t$os_totalvirtmem KB\n";
print "Available Virtual Memory\t$os_freevirtmem KB\n";
print "Page File Space\t\t\t$os_pagefilesize KB\n";
Getting the Current TabItem when the Tab is not selected in WPF
-
[image: Banner]
This is a quick reminder to self on how to retrieve a TabItem from a WPF
TabControl *when the tab is not currently selected* because I ru...
1 week ago
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!