Jump to content

Recommended Posts

Posted (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 by gcue
Posted (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 by JFX
Posted

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.

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
×
×
  • Create New...