gcue 10 Posted February 17, 2011 (edited) I am trying to get a return value with this: $copy = RunWait(@AutoItExe & ' /AutoIt3ExecuteLine "FileCopy(''' & $source_path & ''', ''' & $target_path & ''', 1 )"') MsgBox(0,"",$copy) but i think that returns the value for RunWait. this doesnt work either: local $copy RunWait(@AutoItExe & ' /AutoIt3ExecuteLine ' & $copy & '=' & '"FileCopy(''' & $source_path & ''', ''' & $target_path & ''', 1 )"') MsgBox(0,@error,$copy) reason i am using /autoit3execulteline is because i am copying large files, gui becomes unresponsive if i dont use it. can anyone shed any light on this? thanks! Edited February 17, 2011 by gcue Share this post Link to post Share on other sites
JFX 10 Posted February 17, 2011 (edited) try to put the filecopy inside the Exit function to let the interpreter end with the return of filecopy: $copy = RunWait(@AutoItExe & ' /AutoIt3ExecuteLine "Exit(FileCopy(''' & $source_path & ''', ''' & $target_path & ''', 1 ))"') Edited February 17, 2011 by JFX Share this post Link to post Share on other sites
gcue 10 Posted February 17, 2011 (edited) works great! so what is it exiting? thanks JFX!! Edited February 17, 2011 by gcue Share this post Link to post Share on other sites
JFX 10 Posted February 17, 2011 works great! so what is it exiting?thanks JFX!!The Exit() function will set the %ErrorLevel% of the newly started Autoit.exe to 1 if Filecopy was successfully or to 0 if filecopy failed.The RunWait will save that %ErrorLevel% in the $copy variable. Share this post Link to post Share on other sites