Sign in to follow this  
Followers 0
ksmith247

HotFixID from QFE

4 posts in this topic

Ok, I can pull data that is under Win32_QuickFixEngineering but the issue is displaying it. I am simply outputting to a msgbox (dont know how to use listview yet) but there are so many of them. How can I get all instances of HotFixID from QuickFixEngineering to display all in one window? Not only that but how can I NOT list anything named "File 1"?

Can someone point me in the right direction?

Case $msg = $Button_15 ; HotFixes Installed
$ReadInput = GUICtrlRead($Input_1)

$objWMIService = ObjGet("winmgmts:\\" & $ReadInput & "\root\CIMV2")
            
$colItems = $objWMIService.ExecQuery ("Select HotFixID from Win32_QuickFixEngineering")
            
For $objItem In $colItems
$message = "HotFixes Installed on " & $ReadInput & @CRLF & "-------" & @CRLF _
    & $objItem.HotFixID
MsgBox(4096, "QFE Data", $message)
Next

Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Share this post


Link to post
Share on other sites



How about in four colums?

; HotFixIDs in four columns
$ReadInput = @ComputerName
$objWMIService = ObjGet("winmgmts:\\" & $ReadInput & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery ("Select HotFixID from Win32_QuickFixEngineering")
$Col = 1
$message = "HotFixes Installed on " & $ReadInput & @CRLF & "-------" & @CRLF
For $objItem In $colItems
    If $objItem.HotFixID <> "File 1" Then
        $message &= $objItem.HotFixID
        If $Col < 4 Then
            $Col += 1
            $message &= @TAB
        Else
            $Col = 1
            $message &= @CRLF
        EndIf
    EndIf
Next
MsgBox(64, "Results", $message)

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Very nice. Thank you.

Now, why does it work? I am not a programmer by any stretch, but I think I have part of it.

$Col is for Column

Column equals 1 (which I assume is telling the program to start at column position 1)

message is HotFixes insalled on <computer name>

For (I get that one)

If the object is not "File 1", Then

message = HotFixID

(Here is where it gets confusing)

If the current column is less than column #4 Then

move to the next column

print the HotFixID and then TAB over

Or if the column position is 1

print the HotFixID and line feed


Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Share this post


Link to post
Share on other sites

If the object is not "File 1", Then

message = HotFixID

(Here is where it gets confusing)

The formatting of that "&=" operator is significant. It means "append the string with...".

Read the help file under operators.

If the current column is less than column #4 Then

move to the next column

print the HotFixID and then TAB over

If the column is less than 4, append the string with a TAB, and increment the column number. Another of those special operators. The operator "+=" is "increment by...".

Or if the column position is 1

print the HotFixID and line feed

You mis-read it here. If the column is exactly 4 then append the string with a carriage return/line feed (DOS end of line), and change the column back to 1.

Now for homework, read the AutoIt help file on Operators, and apply these concepts to your script. Don't forget the quiz next Thursday...

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0