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

Hello

I would like to use Dopus to copy a number of manually selected files
(and also folders, if possible) to another harddisk for backup purpose.

My idea is to have a toolbar button, which then initiates the file transfer
to that other location, overwriting the existing files there, if any.

Examples could be:

C:\Users\Outlook\outlook.pst (single file)
D:\Pictures\Family\ (Folder)
C:\Program Files\FTP-Program\Sites.dat (single File)

The 2 files and the folder with all the pictures inside should then
be copied to (for example) E:\Backup

I don´t have the knowledge for the necessary commands for that
button, can you help me out with that ??

Thanks so much !

This copies selected files and folders in the active source lister to E:\Backup overwriting existing files.

copy {o} to "E:\Backup" force

Well thanks for your help, but my files are across several HD´s in my PC
and ONE lister will not show them all...

Also, I dont want to select all files/folders each time, it should
be an automated process.

This should work:

Copy "C:\Users\Outlook\outlook.pst" TO "E:\Backup" Copy "D:\Pictures\Family" TO "E:\Backup" Copy "C:\Program Files\FTP-Program\Sites.dat" TO "E:\Backup"

Add the FORCE argument, like in Zippo's example, if you want to prevent overwrite prompts and always replace the destination files.

Not sure if my question still adhers to the "one question per thread" but seemed like the best thread to ask so here goes.

I'm trying to do something very similar (a super simple button-triggered daily backup), but since I have to change the structure of the directories within source folders quite often, my guess is that the best thing to do is to delete everything in the P:\Backup directory first before starting the copy process?

Even if I have to delete the old backup before writing the new one it's not a big deal at all since the directories and their subdirectories that I want to back up are very small. Or is there an easier way to go about it?

Delete then copy sounds like the right thing to do, if it's a small amount of data.

You should be able to add the Delete command on the first line so it's still a one-click button.

If you want to avoid deleting the backup folder itself, and only delete the contents, try something like this:

Delete "E:\Backup\*" <then>

Try it in a safe test area first in case it doesn't work as expected. :slight_smile:

Alternatively, if you want to keep several historical backups, you could do the copy into a new folder each time, using the current date as part of the name. (Or into a zip archive with a similar date-stamped name.) Shout if you want help creating that.

I'll go with deleting first then.

Reading the helpfile, I see Delete has the FORCE argument, this is probably the one I'll have to use to remove the files that have to be unprotected first before processing.

Fortunately I don't need historical backups since I never delete files - tried out tons of versioning software and in the end decided it's best if I just save a new version every time.

Thanks a lot :slight_smile:

This works nice and everything, however after I reshuffled my configuration now I get the message that the "System Volume Information" can't be copied / access is denied. I'm sure this message wasn't popping up before?...

Anyway I guess I should set up a filter that ignores the hidden and system attributes in the preferences, and then make the copy use that filter. But how? Should I use COPYFILTER or FILTERS in the same line (after COPY "P:*" to "R:\backup\p"), put it somewhere before the COPY, or use the SET? Or is there an easier way to go about it?

ok found it, I just have to type the "Filter=(name)" after the "Copy" part.

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\"

I've tried the suggestions in here but for some reason this doesn't work. I'm using latest version of DOpus...and I get message saying "can't copy files into itself?!".

I'm trying to copy a selected file from one folder on one HD into another folder on a different HD. It won't let me do this. Please help. Thanks.

What's an example of a command that doesn't work?

The ones Leo is posting in the thread.

I'm trying to copy FLV files to a different folder on a separate HD (USB, naturally) and the command...

COPY {o} TO "E:\Backup" FORCE doesn't work...period.

That's not a command I posted (Scred posted it), but anyway...

Do you have an E:\Backup folder to copy into?

Which folder are you in, and what do you have selected, when you click the button?

[quote="leo"]That's not a command I posted (Scred posted it), but anyway...

Do you have an E:\Backup folder to copy into?

Which folder are you in, and what do you have selected, when you click the button?[/quote]

I carefully selected the ACTIVE lister with the actual file selected when I click on the button with the code that was mentioned. Nothing happens. And it shouldn't matter what directory I choose for the backup...oh...I'm beginning to see.

I was under the impression the command I used for the action was simply copying the selected file into a directory folder on a different drive. I'm getting the feeling the problem is the code doesn't take into account that the file I want copied is NOT in the same directory on the SAME drive. It's a DIFFERENT drive I want the file copied to. If the command in question can't do this...then there is either a problem with the command not working as advertised or there must be a workaround command that bypasses this problem.

The code copies files to E:\Backup. That's what the whole TO E:\Backup part means... If you don't have an E:\ drive or there isn't a Backup folder on it then the button isn't going to work because the command is explicitly telling it to copy to a location which doesn't exist...

It can't copy to any other named folder but "E:\Backup"?!

Leo, the command is simply not working. I want to copy FLV files from one folder on a HD named C..and I want to copy FLV files into ANOTHER directory located onto a DIFFERENT drive. This command doesn't work.

Let me be clear....

copy {o} TO "E:\BACKUP" FORCE isn't recognizing the command "force"...and it's not working even without it.

Which directory do you actually want to copy to? What's the full path of the destination directory (including the drive it's on).

If you put TO E:\Backup into the command, where do you think it's going to copy to?

The command can copy to wherever you want it to. If you tell it to copy to E:\Backup then that's where it will copy to, if E:\Backup actually exists on your computer.

If E:\Backup doesn't exist on your computer then telling Opus to copy files to E:\Backup obviously isn't going to work and you need to tell it to copy to somewhere else (or not use the TO argument at all so that the copy goes to the destination window).

If you're not telling Opus to copy to E:\Backup then you've pasted the wrong command in your messages because the command in your messages so far explicitly says, TO E:\Backup.

I solved the problem...the command should be:

copy {allfile} to "e:\backup"

And this copies all the files selected from source to destination regardless of destination location. So it does work.

I modified it to be

copy move {allfile} to "e:\backup"

I would like to modify it further to warn me if the drive in question doesn't exist. Is there any way of adding a command to the button that warns me if the selected folder isn't available because maybe the USB drive isn't listed, or the drive name changed?

Just curious. In any case, the command does work...but you need to use {allfile}