Sign in to follow this  
Followers 0
Lemon.fr

_FileCopy function

2 posts in this topic

Hi all,

i just discovered this interesting function :

Func _FileCopy($fromFile,$tofile) 
    Local $FOF_RESPOND_YES = 16
    Local $FOF_SIMPLEPROGRESS = 256
    $winShell = ObjCreate("shell.application")
    $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)
    return $winShell
EndFunc

I like it because it permits the copy process to be done with the SuperCopier hook.

Probleme for me is that the function launch the object method and script continues to run so...

Is there way to pause the script until copy process is done ? a way for the script to check itself when copy process is done ?

Thanks in advance for your answers :)

Share this post


Link to post
Share on other sites



Hi, I have used that little function for day one with autoit.

But the scripts actually WAIT for that functions to finish (the copy..)

In my programs I don't have the last line :

return $winShell

so i was wandering what is returning, but from my tests it is returning nothing.. (null ?) also in the case of error in copy (example non-existant paths).

Without that line the function returns always 0, like every function with no return lines... (right ?)

for testing results now I use a little cicle after calling the function checking if in the destination path there is the file copied.

Bye

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