trashy Posted January 9, 2017 Share Posted January 9, 2017 (edited) Never had anything like this happen before. Tried to open a driver inf file that was corrupt and the whole thing crashed! $of_T9Button4 = FileOpenDialog("Select Driver Inf", GUICtrlRead($T9Input1), "Inf Files (*.inf)", 1, "") Tried If @error Then Return also tried a msgbox still crashed Exit code : 1 but not showing any errors Edited January 9, 2017 by trashy Link to comment Share on other sites More sharing options...
Subz Posted January 9, 2017 Share Posted January 9, 2017 The FileOpenDialog only returns the path to the file you select, i.e. <FilePath>\filename.inf, there is no error checking on the file itself as far as I'm aware, except for the flags i.e. only if file exists, so the error has to be coming from somewhere else are you able to post more of your script? Link to comment Share on other sites More sharing options...
trashy Posted January 9, 2017 Author Share Posted January 9, 2017 I solved the corrupt inf file problem. Now something very odd with the Recursive file search process you wrote for me. Just stopped by to update both threads Case $T9Button4 $of_T9Button4 = FileOpenDialog("Select Driver Inf", GUICtrlRead($T9Input1), "Inf Files (*.inf)", 1, "") GUICtrlSetData($T9Input3, $of_T9Button4) If GUICtrlRead($T9Input3) = "" Then Return Else $file = GUICtrlRead($T9Input3) $text = FileRead($file) $entry1 = _StringBetween($text, "[VERSION]", "[") $entry2 = _StringBetween($text, "[Manufacturer]", "[") If @error Then MsgBox($MB_SYSTEMMODAL, "", "The driver inf file is not valid.");<<<<this fixed it Return EndIf GUICtrlSetData($T9Edit2, "Driver Info" & @CRLF & @CRLF & "[Version]" & $entry1[0] & "[Manufacturer]" & $entry2[0]) EndIf 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