Trying to figure out the parameter to use in a command function to do that, when nestled several layers down in sub folders (in respect of creating a toolbar button for) .
For example if you have:
'C:\Root\Base\Sub\dir2\dir1' and you are nestled 3 or 4 sub directorys
down in \dir1 - from the "Root" folder... and the button you make for example will move the selected files out of \dir1 and up to folder C:\Root. I know the below command will do that and take you only up to \dir2...the parent of \dir1...
Copy MOVE {filepath$} TO {filepath$|....} which is only one folder up...
So that is the question, the syntax to walk those files up out of all sub dirs and into the "Root"/grand parent folder. Is that button possible?
Thanks if anyones got a tip..
You an use things like {filepath$|} to get the root of a path.
So in your example where you want to move to C:\Root the command would be:
Copy MOVE {filepath$} TO "{filepath$|\}Root"
If you are not planning to use this button on Collections like Find Results, then you should use this instead:
Copy MOVE TO "{sourcepath$|\}Root"
Outside of Collections, every file is on the same drive and thus has the same destination folder. Doing it the second way means the copy command is run only once, and will show you overall progress for the whole operation, instead of being run once per file.
@ Leo - thank you for your response, but what I was looking for in the end result of the buttons function, was for the command parameters, in the command, to DELINEATE what the initial/root folder is, of whatever subdir you are in, of the folder hierarchy ..therefore the button could be used globally regardless of where you are. In your example, the command has parameters that are specifically telling it what the initial/root folder is..so you lose the global functionality of the button (follow that)?
Ah, okay. I'd call C:\Root the second level folder (and call C:\ the root), but I see what you mean now.
I don't know of a way to do that, without resorting to VBScript or similar. Opus lets you find the drive letter, or the Nth parent working right-to-left, but not the Nth root working left-to-right.