dwarf Posted August 8, 2019 Share Posted August 8, 2019 I am writing a script that checks if firefox , notepad++ and java are installed . The catch being that i need a GUI where it is written in, something like a Messagebox or something similar. I am new to this so sry if i am asking dumb questions. Link to comment Share on other sites More sharing options...
Developers Jos Posted August 8, 2019 Developers Share Posted August 8, 2019 5 minutes ago, dwarf said: I am new to this so sry if i am asking dumb questions. Which question is that exactly, as there is none in your post? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
dwarf Posted August 8, 2019 Author Share Posted August 8, 2019 1 minute ago, Jos said: Which question is that exactly, as there is none in your post? Jos sry i got sidetracked when i was typing ^^', i wanted to ask if I could get some help writing the script ? thanks for the help in advance ! Link to comment Share on other sites More sharing options...
Developers Jos Posted August 8, 2019 Developers Share Posted August 8, 2019 (edited) We are helping for sure, but aren't writing it for you. So what have you tried already and what isn't working? Jos Edited August 8, 2019 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
dwarf Posted August 8, 2019 Author Share Posted August 8, 2019 (edited) 17 minutes ago, Jos said: We are not helping for sure, but aren't writing it for you. So what have you tried already and what isn't working? Jos Well I don't know how to go about this but I can get .txt file to appear with all programs but i only want to check the 3 in a message box expandcollapse popup$wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output &= "Computer: " & $strComputer & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Product", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Output &= "Caption: " & $objItem.Caption & @CRLF $Output &= "Description: " & $objItem.Description & @CRLF $Output &= "IdentifyingNumber: " & $objItem.IdentifyingNumber & @CRLF $Output &= "InstallDate: " & $objItem.InstallDate & @CRLF $Output &= "InstallDate2: " & WMIDateStringToDate($objItem.InstallDate2) & @CRLF $Output &= "InstallLocation: " & $objItem.InstallLocation & @CRLF $Output &= "InstallState: " & $objItem.InstallState & @CRLF $Output &= "Name: " & $objItem.Name & @CRLF $Output &= "PackageCache: " & $objItem.PackageCache & @CRLF $Output &= "SKUNumber: " & $objItem.SKUNumber & @CRLF $Output &= "Vendor: " & $objItem.Vendor & @CRLF $Output &= "Version: " & $objItem.Version & @CRLF Next ConsoleWrite($Output) FileWrite(@TempDir & "\Win32_Product.TXT", $Output ) Run(@Comspec & " /c start " & @TempDir & "\Win32_Product.TXT" ) Else Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_Product" ) Endif Func WMIDateStringToDate($dtmDate) Return (StringMid($dtmDate, 5, 2) & "/" & _ StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _ & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2)) EndFunc Edited August 8, 2019 by Jos Added codebox Link to comment Share on other sites More sharing options...
Developers Jos Posted August 8, 2019 Developers Share Posted August 8, 2019 (edited) So I guess you found this script somewhere and don't understand how it is working yet? What about playing with it and adding some sort of If statement around the FileWrite()? Jos Edited August 8, 2019 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
dwarf Posted August 8, 2019 Author Share Posted August 8, 2019 yeah I was looking up some help but only found this , would you recommend i put a if statement in the if statement or keep the Filewrite() out of the existing if statement ? thanks for the help so far !😊 Link to comment Share on other sites More sharing options...
Developers Jos Posted August 8, 2019 Developers Share Posted August 8, 2019 Just try some stuff, make mistakes, open the helpfile to look for syntax and learn. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
dwarf Posted August 8, 2019 Author Share Posted August 8, 2019 thanks alot man i manged to finish it figured it out more or less Link to comment Share on other sites More sharing options...
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