Jump to content

Recommended Posts

Posted

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

Posted

It's a pity if it's more complex. I suppose I could cheat and just call a DOS copy, but it seemed like I should be able to do it in AutoIt. I would need a search first to do file-by-file copy though.

Posted

No it doesn't, I knew I'd have to code my own solution around this, but this isn't very important as it's unlikely to fail. At first I just wanted a way to copy the whole directory, and DirCopy shall fit nicely :-)

Posted

Grrr... Time wasted. :|

<{POST_SNAPBACK}>

Nobody to grrr at except yourself. You could of just as easily mentioned DirCopy as I did.
Posted

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:

Posted

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

Maybe... But it actually seems that you dont read the posts sometime.

<{POST_SNAPBACK}>

Not Valik, you!

Did you read this sentence:

Simply, I want to be able to copy a whole directory with all it sub-folders and files to another.

Posted

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.

Posted

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

Posted

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!

Posted

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?
Posted

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.

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
  • Recently Browsing   0 members

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