ksmith247 Posted April 30, 2007 Posted April 30, 2007 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]
PsaltyDS Posted April 30, 2007 Posted April 30, 2007 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
ksmith247 Posted April 30, 2007 Author Posted April 30, 2007 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]
PsaltyDS Posted May 1, 2007 Posted May 1, 2007 If the object is not "File 1", Thenmessage = 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 Thenmove to the next columnprint the HotFixID and then TAB overIf 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 1print the HotFixID and line feedYou 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now