Sign in to follow this  
Followers 0
xzaz

ShellExecute canceled

7 posts in this topic




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

#3 ·  Posted (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 by xzaz

Share this post


Link to post
Share on other sites

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

Not in Vista

Well 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

#6 ·  Posted (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 by xzaz

Share this post


Link to post
Share on other sites

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

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  
Followers 0