in reply to Win32::OLE made easy!


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.
Scriptomatic 2.0: Readme

Throughout most of history people were much easier to please than they are now. For example, it's unlikely that anyone ever went up to Luke the evangelist and said, "One Gospel? Come on, Luke. I mean, Matthew, Mark, John - anybody can write one Gospel." Upon being introduced to someone at a cocktail party Neil Armstrong probably never had to hear, "Oh, first man on the moon? I see ...." Did anyone ever say to the Pharaoh Cheops, "Well, it's a good pyramid, Cheops, but I don't know about a great pyramid ...." Of course they didn't.

Well, not if they knew what was good for them, anyway.

Today it's a bit different: not only are people notoriously hard to please, but even if you do have a success there's no guarantee that anyone will be satisfied. After all, nothing is worse than being labeled a one-trick pony, a one-hit wonder, or a flash-in-the-pan. We remember William Shakespeare, but only because he wrote hundreds of plays and sonnets. Who remembers the rock duo Mouth and McNeal? Nobody. And that's because Mouth and McNeal had one hit song, and then were never heard from again. Stephen King will be remembered forever because of his prolific productivity, but does anyone out there have the slightest idea who wrote the Epic of Gilgamesh?

Well, OK, it probably was Stephen King. Then what about - right, he probably wrote that, too. But you know what we mean.

Now, to be honest, we Microsoft Scripting Guys were never too concerned about being one-hit wonders; after all, you can't be a one-hit wonder unless you first have a hit. We were sure nobody would ever hear of us, and somehow that seemed better than being remembered and then just as quickly forgotten. Remember baseball's Joltin' Joe Charboneau? Exactly.

But then we made a terrible mistake: we released the original Scriptomatic - the amazing utility that actually wrote WMI scripts for you - and it turned out to be a hit. That was not intentional, by the way. The Scriptomatic was originally thrown together when one of the Scripting Guys was looking for a socko-boffo ending for a WMI presentation he had to make for an internal Microsoft audience. Literally minutes before the presentation was to begin, he created something called the Scriptomatic, an HTA (HTML Application) that could write rudimentary WMI scripts. He showed off his new creation at the end of the talk, and the response was both overwhelming and unanimous; as noted in the official annals of the Scripting Guys, everyone in the room stood up as one and said, "Can we go now?" Not the most auspicious debut a piece of software has ever had, though it probably still tops the reception accorded Microsoft Bob.

...

It goes on like that.

--
John.

Replies are listed 'Best First'.
Re^2: Win32::OLE made easy!
by BrowserUk (Patriarch) on Feb 08, 2005 at 01:13 UTC
    ... 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.