The "Microsoft Scripting Guys" have made Scriptomatic 2.0 available. To quote from the authors:

"A completely new version of the famous Scriptomatic, the utility that writes WMI scripts for you. (And, in the process, teaches you the fundamental concepts behind writing WMI scripts for yourself.) Unlike its predecessor, Scriptomatic 2.0 isn’t limited to writing just VBScript scripts; instead, Scriptomatic 2.0 can write scripts in Perl, Python, or JScript as well."

Hope this is some use to those of you who are using Perl to access all those crufty WMI objects.

Replies are listed 'Best First'.
Re: Win32::OLE made easy!
by jmcnamara (Monsignor) on Feb 08, 2005 at 01:01 UTC

    Pretty cool. Here is the example it produces for Win32_registry (unedited):
    use strict; use Win32::OLE('in'); use constant wbemFlagReturnImmediately => 0x10; use constant wbemFlagForwardOnly => 0x20; my @computers = ("INSPIRON"); foreach my $computer (@computers) { print "\n"; print "==========================================\n"; print "Computer: $computer\n"; print "==========================================\n"; my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\ +root\\CIMV2") or die "WMI connection failed.\n"; my $colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_Regis +try", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly); foreach my $objItem (in $colItems) { print "Caption: $objItem->{Caption}\n"; print "CurrentSize: $objItem->{CurrentSize}\n"; print "Description: $objItem->{Description}\n"; print "InstallDate: $objItem->{InstallDate}\n"; print "MaximumSize: $objItem->{MaximumSize}\n"; print "Name: $objItem->{Name}\n"; print "ProposedSize: $objItem->{ProposedSize}\n"; print "Status: $objItem->{Status}\n"; print "\n"; } }sub WMIDateStringToDate(strDate) { return "blah"; }
    But the Readme file is genuinely bizarre. Someone should tell the "Scripting Guys" that they aren't that funny. They sound like a bad parody of teenage hackers.
      ... but does anyone out there have the slightest idea who wrote the Epic of Gilgamesh?

      And there was me thinking this was the product of the ST:NG writers imaginations.


      Examine what is said, not who speaks.
      Silence betokens consent.
      Love the truth but pardon error.
A reply falls below the community's threshold of quality. You may see it by logging in.