How to copy several files to another location with a button?

You don't need {allfile} at all, just Copy TO E:\Backup will work just fine.

[Edit: Posted at the same time as Jon so some of this duplicates what he said, but there are some extra details, too.]

Actually, the command shouldn't really have {o} or {allfile} in it at all. Try this instead:

Copy MOVE TO "E:\Backup"

That should work, assuming you have an E:\Backup folder to copy to.

(I'd expect the other versions to work to some degree as well, but they won't work as well as the version in this post. I was waiting until we sorted out the other problem before mentioning this detail to avoid confusing things.)

If the drive doesn't exist then you'll get an error message saying so automatically.

Confirmed, Leo. The shortened command works nicely.

[quote="leo"]Using a filter is one way to do it but you can also just change the * wildcard into one which doesn't match the things you don't want to copy. For example:

Copy "P:\~(System Volume Information|$Recycle.Bin|pagefile.sys)" TO "R:\backup\p"

This sounds like a good idea but I guess I'll start using my new "SysFiles_ignore" filter in other situations too so I tried with that first... but it's not working as expected.

Currently I'm testing it with a simple Copy "P:\*" TO "R:\backup\p" Filter=SysFiles_ignore UpdateAll but no matter how I set up the filter the process just stops every time it reaches System Volume Information part.

At the end I ended up with filters like in the attached picture (which also stops at System V.I.). Any idea why it stops at S.V.I.?


The filter you have will avoid matching things with the H or S attributes set, but it doesn't stop the search function from entering folders with those attributes.

In other words, the folder itself won't match the filter but Opus still still try to look inside of it for things which match (and if anything inside it matches then they will be included, but if there's an error just looking inside the folder then you'll see the error message regardless of what's inside it).

You can use a Sub-Folder clause to avoid entering folders with the H or S attributes set, as shown below.

Also, I think your filter is doing the reverse of what it should. Either way it can be simplified to just the last line as the first two are redundant.

The filter shown below matches all items except those with both H and S attribs set, and also avoids entering folders with both H and S attribs set:

I guessed I don't need the first two lines but since it wasn't working as I expected it to I just tried to break it down and see what needs tuning.

Anyway - yes, now it works, thanks leo! I wouldn't have guessed what needs to be done on my own. Good to know :slight_smile:

Just curious...is there a way to get this copy move code to send the selected file to multiple locations at once?

You can duplicate the command line any number of times and specify a different destination each time.

So you can't loop the command once to do a job multiple times for different folders. Too bad. I wish there was code that could do this.

@Jon
Sorry, but ooops; the thread, at this point anyway, was about Copy Move to several locations.

Reality is that at some point, the source file becomes deleted from one of the Copy Move Commands.
Obviously, if the file has been deleted, the next Copy Move command can't function.
I assume that this deletion cannot occur if the file is locked by another Copy Move Command.

Since the deletion does occur on the first Copy Move, erroring the second Copy Move command,
it does make sense, to to me at least, to use multiple lines for this task.
All but the last line would by a Copy, and the last line would be a Copy Move.

Perhaps I'm a little nuts about this, but it seems to me that things copy faster one at a time rather than several at once.
In the past, one window has seemed faster to me than multiple windows .
I'm not that certain of my facts at the moment though.
With multi-core processors and all, things may be different now.
I'll have to give it all a try again.

But I think Dorothyfan1 is right, her idea does make sense.

Regards,
David

I used a 1 GB file to test this on Vista32.
Core 2 Duo processor.

Ooops myself,
It does say selected files doesn't it ?
:blush:

So you can't loop the command once to do a job multiple times for different folders. Too bad. I wish there was code that could do this.[/quote]

What advantage would a loop have here?

If you really need a loop then you can use VBScript and run the Opus commands using dopusrt.exe. With a file copy you'd just be writing a lot of code to generate the simple duplicated-lines version that Jon suggested, though.