Jump to content

trying to get a return value from FileCopy


gcue
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...