Jump to content
Sign in to follow this  
mcgill

Imagex /info - _Stringbetween info is blank

Recommended Posts

mcgill

I am trying to use the code below to pull certain field data from a WIM file, but it keeps returning empty fields. If I manually run the command or pump it to a text file I know it is working and the array is also not empty. For some reason don't know why _Stringbetween is not grabbing the value. Any help would be appreciated, thanks

Func PollImageInfo($read, $y)

Dim $nitem

Dim $imageinfo = " "

; $read = GUICtrlRead($hApplySourceEdit)

;MsgBox(0, "DEBUG $read", $read)

$sCmd = "imagex.exe"

If $read = "" Then

MsgBox(48, "Input required", "Please select the source")

Else

$sCmd = $sCmd & ' /info "' & $read & '"'

EndIf

;MsgBox(0, "scmd", $sCmd)

Dim $ret = Run(@ComSpec & " /c " & $sCmd & '"', @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

While 1

$line = StdoutRead($ret)

If $line = "" Then ExitLoop

$imageinfo = $imageinfo & $line

;MsgBox(0, "RunDOS", $line)

If @error Then ExitLoop

WEnd

_GUICtrlTreeView_DeleteAll($treeview)

$aImageInfo = _StringBetween($imageinfo, "<NAME>", "</NAME>")

If @error Then $aImageInfo = _ArrayCreate("<Empty>")

$aImageDesc = _StringBetween($imageinfo, "<Description>", "</Description>")

If @error Then $aImageDesc = _ArrayCreate("<Empty>")

$aImageFileCount = _StringBetween($imageinfo, "<Filecount>", "</Filecount>")

If @error Then $aImageFileCount = _ArrayCreate("<Empty>")

$aImageSize = _StringBetween($imageinfo, "<TOTALBYTES>", "</TOTALBYTES>")

If @error Then $aImageSize = _ArrayCreate("<Empty>")

;$aImageBuild = _StringBetween ( $imageinfo, "<Build>", "</Build>" )

; If @error Then $aImageBuild = _ArrayCreate("<Empty>")

$imagenumber = UBound($aImageInfo, 1)

If @error Then $imagenumber = _ArrayCreate("<Empty>")

$x = 0

Dim $nitem[$imagenumber]

If $y = 0 Then

;MsgBox(0, "DEBUG", $y)

Do

$iName = $aImageInfo[$x]

$iDesc = $aImageDesc[$x]

$iFiles = $aImageFileCount[$x]

$iSize = $aImageSize[$x]

GUICtrlSetData($hInfoNewName, $iName)

GUICtrlSetData($hInfoNewDesc, $iDesc)

GUICtrlSetData($hInfoFileCount, $iFiles)

GUICtrlSetData($hInfoFileSize, $iSize)

$x = $x + 1

Until $x = $imagenumber

$z = $x

Else

Do

$iName = $aImageInfo[$x]

$iDesc = $aImageDesc[$x]

$iFiles = $aImageFileCount[$x]

$iSize = $aImageSize[$x]

GUICtrlSetData($hInfoNewName, $iName)

GUICtrlSetData($hInfoNewDesc, $iDesc)

GUICtrlSetData($hInfoFileCount, $iFiles)

GUICtrlSetData($hInfoFileSize, $iSize)

$x = $x + 1

Until $x = $y

EndIf

$iCount = $x

GUICtrlSetData($hInfoNumber, $iCount)

EndFunc ;==>PollImageInfo

Share this post


Link to post
Share on other sites
JohnQSmith

Nevermind, figured it out.

Now you just need to figure out how to use the [autoit] and [/autoit] tags when posting code.
  • Like 1

Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.