Sign in to follow this  
Followers 0
jbennett

_FileCopy function without showing overwrite dialogue box

3 posts in this topic

Hi everyone,

Long time since i've been on here now. I've got a quick question.

Does anyone know how I can get the following code to not display a dialogue box asking me if I want to overwrite files already within the directory.

_FileCopy ($working_location & "*", $backup_location)

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)

EndFunc

Share this post


Link to post
Share on other sites



Check if the file exists and delete it and then copy the file.

Share this post


Link to post
Share on other sites

Odd. Your example will repeatedly re-copy and overwrite an existing file for me without any prompt. Only if I remove the $FOF_RESPOND_YES parameter will it ask for confirmation. XP Pro SP3 here. Maybe Vista behaves differently.

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