Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Perl SysInfo Script - Created by Ace
#1
Here's one of my most recent scripts using the Win32::Registry module to read values and data from the registry for stored information provided for the current status of your system including Windows install information.

[yt]http://www.youtube.com/watch?v=1JHw-PayRIk&fmt=8[/yt]

Code:
#!/usr/bin/perl
use Win32::Registry;

$sublocation = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
$main::HKEY_LOCAL_MACHINE->Open($sublocation, $null) || die "Open: $!"; $null->GetValues(\%ID);

print "\n\            #--Ace\'s Basic SysInfo Script--\#\n";
print "\n------------------\\System Information\\------------------\n\n";
foreach $key_ (keys %ID) {
    if ($key_ eq "RegisteredOwner") {
        $entry = $ID{$key_};
        print "$$entry[0] = $$entry[2]\n";
    } elsif ($key_ eq "ProductId") {
        $entry = $ID{$key_};
        print "$$entry[0] = $$entry[2]\n";
    } elsif ($key_ eq "SystemRoot") {
        $entry = $ID{$key_};
        print "$$entry[0] = $$entry[2]\n";
    } elsif ($key_ eq "ProductName") {
        $entry = $ID{$key_};
        print "$$entry[0] = $$entry[2]\n";
    } elsif ($key_ eq "CSDVersion") {
        $entry = $ID{$key_};
        print "$$entry[0] = $$entry[2]\n";
    } elsif ($key_ eq "CurrentBuild") {
        $entry = $ID{$key_};
        print "$$entry[0] = $$entry[2]\n";
    }
}
print "\n--------------------------------------------------------\n\n";
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Compile Error in Perl liveproject101 0 1,302 04-12-2013, 03:08 AM
Last Post: liveproject101
  [Perl] IRC Bot wchar_t 26 14,563 08-20-2012, 01:40 PM
Last Post: Trump
  Perl Ebook ven0m 2 1,825 05-04-2012, 08:14 AM
Last Post: ven0m
  Help with a program written in perl Rodman42866 1 1,684 03-09-2012, 03:16 AM
Last Post: AceInfinity
  HTML perl script AceInfinity 5 2,722 12-03-2011, 11:35 PM
Last Post: Closed Account

Forum Jump:


Users browsing this thread: 1 Guest(s)