Context menu : Copy file or folder whilst recreating folder structure

I found some older hits on this subject but I am not sure they were they are answers I am looking for and also whether with the newer versions of Opus the below would be possible.

Say I have a deeply nested folder and want to copy that folder to a backup-drive, but wish to keep the folder structure, so I know where the folder is coming from.

For example:
LastFolder in folderpath Q:\Some Test PDFs\SubFolderA\SubFolderB\SubFolderC\SubFolderD\LastFolder
be copied to backup X:\Some Test PDFs\SubFolderA\SubFolderB\SubFolderC\SubFolderD

or
File: SomeAcrobatFile-10012015.pdf
in
Q:\Some Test PDFs\SubFolderA\SubFolderB\SubFolderC\SubFolderD\LastFolder\SomeAcrobatFile-10012015.pdf
be copied to backup
X:\Some Test PDFs\SubFolderA\SubFolderB\SubFolderC\SubFolderD\LastFolder\

In case a file/files are selected in the lastfolder, the files are copied / moved recreating the folder structure at the same time.

Something like the below?

=

Currently 'recreate folder structure' is from top to bottom (root -> bottom nested subfolders)

However, when copying a file and recreating the folder structure at the same time, the recreate folder structure would be let's say 'bottom->root'.

My 2-step workaround now is : (maybe there is a better solution)

  • first recreate folder structure,
  • then copy the file(s) into the newly created folder structure.

Thanks

I'd probably use something like Copy TO X:\{sourcepath$|noroot} but it may take some tweaking.

(Or, if you need it to work in collections and flat-view, maybe
Copy {filepath$} TO X:\{filepath$|noroot|..} )

The old answers you found should still work, and will have the benefit of already being tested back when they were written.

If you link to them, we can tell you if they are still valid or update them as needed.

If I am not mistaken, those discussions are about creating folder structure 'top-down' whereas my idea/question is about creating folder 'bottom-up', during copying from context menu.
Wouldn't know how to create a context menu of this, if at all possible.

I don't know which matching thread(s) you're referring to, so let's ignore that.

Assuming you don't care about collections or flat view for this, try this command:

Copy TO="X:\" CREATEFOLDER={sourcepath$|noroot}

That should copy whatever you have selected to the same location on your X:\ drive.

Give it a try on a toolbar button first, to see if it does what you want. Then we can go through how to move it to a context menu if it's working right for you.

Am not sure. I created a button, then selected a file and used the button.
It warns me for a possible overwrite.
As there are no other files with this name, it is thus warning to overwrite itself.

=


You've changed the command so it has TO="Q:\" instead of TO="X:\", and you're selecting a file that is already on Q, so of course it will be copying to the same place.

You said earlier you wanted to copy From Q:\ to X:\ not Q:\ to Q:\?

Ai! :blush: :blush:

Of course...tsk tsk

blackout - or too hasty to see if it would work - or whatever.
Sorry!

Changed it to another drive and it worked out really fine!

Copy (or move) files or folders with empty folder structure, using context menu, I think I have it now:

Copy CREATEFOLDER={sourcepath$|noroot}
Copy MOVE CREATEFOLDER={sourcepath$|noroot}

thanks!

=