in reply to Re^2: Setting a WMI value using Perl Win32::OLE
in thread Setting a WMI value using Perl Win32::OLE
Another thread here indicated the "Exec Query" SQL like interface is READ ONLY and offered the getting "instancesmy ($init, $max) = (256, 301); for (in($PageFiles)) { showProperties($_); $_->{InitialSize} = $init; $_->{MaximumSize} = $max; $_->LetProperty('InitialSize', $init); $_->LetProperty('MaximumSize', $max); $_->SetProperty(InitialSize => $init); $_->SetProperty(MaximumSize => $max); $_->Put_() # with UNDERSCORE in method name and print "3 Put_: " . Win32::OLE->LastError . "\n\n"; last; # just change 1st one }
But that had nothing to do with my problem -- both methods work as long as you use the proper Put_ (with underscore) method. All 3 setting methods (hash assign, Let, and Set) seem to work fine even though not sure the differences if any.#my $PageFiles = $wmiService->ExecQuery("Select * from Win32_PageFileS +etting"); my $PageFiles = $wmiService->InstancesOf("Win32_PageFileSetting");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: SOLVED Put_ UNDERSCORE: Setting a WMI value using Perl Win32::OLE
by Anonymous Monk on Jul 11, 2011 at 04:19 UTC |