xzaz 0 Posted October 4, 2007 How can i check (with @error o.s.l.t) if the Execute was cancelled by the user? ShellExecute($path & "\" & GUICtrlRead(GUICtrlRead($ListView))) Small Color Picker v0.2 | Travian bot Share this post Link to post Share on other sites
SmOke_N 211 Posted October 4, 2007 How can i check (with @error o.s.l.t) if the Execute was cancelled by the user? ShellExecute($path & "\" & GUICtrlRead(GUICtrlRead($ListView))) How would the "user" stop it? It's a direct call. Other than that:To set @error to 1 as an indication of failure, see AutoItSetOption.Look at "Opt" and "RunErrorsFatal" Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
xzaz 0 Posted October 4, 2007 (edited) Not in Vista, when you Allow the program to run it good, but when you cancel: C:\Users\xx\Documents\Project one\Main.au3 (107) : ==> Unable to execute the external program.: $shell = ShellExecute($path & "\" & GUICtrlRead(GUICtrlRead($ListView))) The operation was canceled by the user. The program launges a .lnk file but when the .lnk file cant find the program the whole program shuts down with the above error. Tried it with "Opt" and "RunErrorsFatal" But no help on there. I cant put a fileExists if and else statement because the .lnk link always exist but the program not. Hope you still understand Edited October 4, 2007 by xzaz Small Color Picker v0.2 | Travian bot Share this post Link to post Share on other sites
smashly 12 Posted October 4, 2007 Use something like a string check to see if it's a .lnk , if so then use FileGetShortcut(), then check if file exists.. eg:$fPath = @DesktopDir & "\SciTe.lnk" If StringMid($fPath, StringInStr($fPath, '.', 0, -1)) = ".lnk" Then $fDetail = FileGetShortcut($fPath) If Not @error = 1 And FileExists($fDetail[0]) Then ShellExecute($fDetail[0]) ElseIf Not StringMid($fPath, StringInStr($fPath, '.', 0, -1)) = ".lnk" Then If FileExists($fPath) Then ShellExecute($fPath) EndIf Cheers Share this post Link to post Share on other sites
SmOke_N 211 Posted October 4, 2007 Not in VistaWell there you go then... I've never even seen the Vista OS. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
xzaz 0 Posted October 5, 2007 (edited) Well there you go then... I've never even seen the Vista OS.Its a "Unable to execute the external program" Windows vista tells me that i am canceling the program NO I DIDNT! "E:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\x\Documents\Project one\Main.au3" C:\Users\x\Documents\Project one\Main.au3 (134) : ==> Unable to execute the external program.: ShellExecute($path & "\" & GUICtrlRead(GUICtrlRead($ListView))) The operation was canceled by the user. BTW: I love vista, it tells me something i didnt do! Edited October 5, 2007 by xzaz Small Color Picker v0.2 | Travian bot Share this post Link to post Share on other sites
smashly 12 Posted October 5, 2007 Its a "Unable to execute the external program" Windows vista tells me that i am canceling the program NO I DIDNT! "E:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\x\Documents\Project one\Main.au3" C:\Users\x\Documents\Project one\Main.au3 (134) : ==> Unable to execute the external program.: ShellExecute($path & "\" & GUICtrlRead(GUICtrlRead($ListView))) The operation was canceled by the user.oÝ÷ ØÖ"Z/zø¬µ¨µée²g¬¢g)àØ×hßêº^b«+,x,¢g)à³k¢ ÚåEæ)¶µz +kte ÚåEæÓ~Ëoì5[(z÷§ü¨¹§]¶ªºuªê-¶§è¶¹Qy§pYkzÛ«Ø^+-¾'°×¦µìm~íì!¢W¢µé¥wzX¦×Â+aªê-ªê-J¨ºwvÚ+zÚâz÷çâ®Ëij»h~Ø^²Úâ®¶sdgVæ2ÅdvWE6VÅFWB buT7G&Å&VBuT7G&Å&VBb33c´Æ7GfWrÂfÇC²fwC²gV÷C²gV÷C²FVà FÒb33cµ4ÅbÒ7G&æu7ÆBuT7G&Å&VBuT7G&Å&VBb33c´Æ7GfWrÂÂgV÷C·ÂgV÷C² Æö6Âb33c¶eFÒb33c·FfײgV÷C²b3#²gV÷C²fײb33cµ4Åe³Ð b33c´WBÒ7G&æu&vBb33c¶eFÂB 7vF6b33c´W@ 66RgV÷C²æÆæ²gV÷C° b33c¶dFWFÂÒfÆTvWE6÷'F7WBb33c¶eF bæ÷BW'&÷"ÒæBfÆTW7G2b33c¶dFWFųÒFVâ6VÆÄWV7WFRb33c¶dFWFÅ³Ò 66RVÇ6P bfÆTW7G2b33c¶eFFVâ6VÆÄWV7WFRb33c¶eF VæE7vF6 VæD`¤VæDgVæ Cheers Share this post Link to post Share on other sites