GregThompson Posted September 1, 2006 Share Posted September 1, 2006 I just wrote this in the last 5 minutes... works well. It's very rudimentary at this point, but you can customize the code as seen fit. This will be a part of the SAP Patch Tool I'm creating... Enjoy! expandcollapse popup#include <Array.au3> $file = FileOpen("\\Server\SAPShare\setup\sapsetup.xml", 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $result = StringInStr($line, "SAP FA") If $result <> 0 Then $array = StringSplit($line, '"') For $i = 1 to $array[0] $pulled = StringInStr($array[$i], "name=") If $pulled <> 0 Then $p = $i + 1 $name = $array[$p] $p = 0 ExitLoop EndIf Next For $i = $array[0] to 1 Step -1 $pulled = StringInStr($array[$i], "version=") If $pulled <> 0 Then $p = $i + 1 $version = $array[$p] ExitLoop EndIf Next MsgBox(0, "SAP Patch Level Detection", "Patch name: " & $name & @CRLF & "Patch Version: " & $version) EndIf Wend FileClose($file) 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