The Roth Consulting Script Repository is a great place to find all sorts of interesting and useful Perl scripts. Check it out:
http://www.roth.net/perl/scripts/

One Response to “Script Repository”

  1. dineshkhanna Says:

    Need help in Perl scripting to get system details in windows XP operating system.Currently I am using win32 class to get the system details like RAM size, processor speed ,Hard disk capacity and fetching the list of installed software.I would like to write the Perl script to get the above system details without using win32 class.
    I will be great if you could able to guide me to write the Perl script to get the above system details without using win32 class.
    Below is the sample code which I am currently using to get Hard Disk capacity in Perl,
    use strict;
    use Win32::OLE(‘in’);
    use constant wbemFlagReturnImmediately => 0×10;
    use constant wbemFlagForwardOnly => 0×20;
    my @computers = ($_[0]);
    foreach my $computer (@computers)
    {
    my $objWMIService = Win32::OLE->GetObject(“winmgmts:\\\\$computer\\root\\CIMV2″) or die “WMI connection failed.\n”;
    my $colItems = $objWMIService->ExecQuery(“SELECT * FROM Win32_DiskDrive”, “WQL”,
    wbemFlagReturnImmediately | wbemFlagForwardOnly);
    foreach my $objItem (in $colItems)
    {
    print “\n”;
    print “Hard Disk capacity : $objItem->{Size}\n”;
    print “\n”;
    }
    }

Leave a Reply

You must be logged in to post a comment.