Jump to content

FileCopy whole dir with subfolders


Recommended Posts

I'm trying to achieve one of two things. Simply, I want to be able to copy a whole directory with all it sub-folders and files to another. I assume this is possible with the FileCopy command in AutoIt, but do you think I can work out the syntax? Can anyone give me a pointer on this?

The second thing is, I'd like to do this, but rather than getting a result at the end as to whether the whole thing completed or failed, what happened with each individual file. I assume this would work in, get a list of files in dir (and sub-dirs), copy each one, and log the result.

Can anyone get me started on this either?

Cheers

Chris

Link to comment
Share on other sites

Well. I knew that DirCopy dont allow copy one item per time!

Thats why I pointed him to Larry script!

Grrrr...

And anyway, that GRRR is only a joke. Said smiling! :ph34r:

<{POST_SNAPBACK}>

Look at what they want to do, not how they want to do it. They wanted to copy a directory. Sure, they might have wanted to do it one item at a time, but it's better to confirm that is in fact the goal by pointing out there is a better way first and seeing what the response is.
Link to comment
Share on other sites

YOU AND VALIK! :ph34r:

The second thing is, I'd like to do this, but rather than getting a result at the end as to whether the whole thing completed or failed, what happened with each individual file. I assume this would work in, get a list of files in dir (and sub-dirs), copy each one, and log the result.

Link to comment
Share on other sites

Think about this for half a second ezzetabi. DirCopy() returns 1 on success, 0 on failure. There is absolutely no need to worry about each individual file and go through all that checking stuff. If a file/directory wasn't copied okay, DirCopy() will return 0 to signify failure. It would only be necessary to check each individual file if each individual file was moved via FileCopy().

Link to comment
Share on other sites

It was a Chris_1013 problem not mine. Also I thought that he/she wanted to copy each individual file for making a very detailed log where he/she could read exatly what files were missing... or who knows?

But... Who cares? Thanks Valik for solving the problem.

Next time I'll answer:

RTFM or use SEARCH! as Chris_1013 deserved since the begin!

Link to comment
Share on other sites

Ok... everybody simmer down. There was a misunderstanding and a misstating with both parties concerned, but there is no reason to go finger-pointing because both made mistakes or misstated. Laying blame will only make both (all three?) people upset, and can lead to no good end.

Who else would I be?
Link to comment
Share on other sites

RTFM or use SEARCH! as Chris_1013 deserved since the begin!

<{POST_SNAPBACK}>

Terribly sorry for the trouble I've caused you chaps. Was a simple mis-understanding. How foolish of me to assume FileCopy didn't work for directories. I wrongly assumed that a command to copy files would be all inclusive such as the 'copy' command on a command line. Simple fault of mine to miss the DirCopy commmand.

A thousand apologies for any distress caused to any of you.

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...