HerbM has asked for the wisdom of the Perl Monks concerning the following question:
Commented lines in the "for" passed the compiler but didn't make any changes (as far as I can see in the Registry or System control panel.) Anyone have any ideas or similar code which sets ANYTHING using Perl OLE WMI??? Thnaksuse strict; use warnings; use Win32::OLE qw(in with); use Win32::OLE::Variant; my $server= '.' ; # "vsin0vw148.svr.us.jpmchase.net"; my $wmiService = Win32::OLE->GetObject("winmgmts:\\\\$server\\root\\CI +MV2"); if (!$wmiService) { print "... WMI connection failed! \n"; } my $PageFiles = $wmiService->ExecQuery("Select * from Win32_PageFileSe +tting"); for (in($PageFiles)) { # $_->{InitialSize} = 300; # $_->{MaximumSize} = 330; # $_->LetProperty('InitialSize', 300); # $_->LetProperty('MaximumSize', 330); $_->LetProperty(InitialSize => 300); $_->LetProperty(MaximumSize => 330); $_->SetInfo(); $_->Put(); last; # just change 1st one } exit 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Setting a WMI value using Perl Win32::OLE
by Anonymous Monk on Jul 10, 2011 at 05:22 UTC | |
|
Re: Setting a WMI value using Perl Win32::OLE
by Anonymous Monk on Jul 10, 2011 at 06:05 UTC | |
by HerbM (Novice) on Jul 10, 2011 at 14:04 UTC | |
by Anonymous Monk on Jul 10, 2011 at 20:29 UTC | |
by HerbM (Novice) on Jul 10, 2011 at 22:57 UTC | |
by Anonymous Monk on Jul 11, 2011 at 04:19 UTC |