gcue Posted February 17, 2011 Share 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 Link to comment Share on other sites More sharing options...
JFX Posted February 17, 2011 Share 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 Link to comment Share on other sites More sharing options...
gcue Posted February 17, 2011 Author Share Posted February 17, 2011 (edited) works great! so what is it exiting? thanks JFX!! Edited February 17, 2011 by gcue Link to comment Share on other sites More sharing options...
JFX Posted February 17, 2011 Share 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. Link to comment Share on other sites More sharing options...
gcue Posted February 17, 2011 Author Share Posted February 17, 2011 genius! 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