Copy/move with all parent folders

I would like a command to copy/move selected files to destination with their parent folders intact. Thanks.

I have done a search and seen commands like this
Copy CREATEFOLDER {sourcepath|nopath|noterm}

But this is not what I want. It only creates the parent folder. I want all the parent folders up to the root created.

For example if I select this file.txt


and run the command with the destination D:\Folder, I should get


nopath gets you just the name at the end of a path, without the other components before it, so you don't want that.

noroot is what you want. It just removes the drive letter from the start of a path and keeps the rest.

Thank you. It works.

One issue I have. How can I make it to copy the hidden system files desktop.ini too? I have set icons for my folders and I lose them if I copy this way.

The CREATEFOLDER argument just creates folders and adjusts the destination to which selected files & folders & their contents are copied.

You would need to write a script if you want it to walk up the tree of parent folders and copy additional files out of them.