Copy Directory Structure

Features wanted...
Post Reply
lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Copy Directory Structure

Post by lukescammell »

Several times a month I come across the need to copy the directory structure of a project for a new one, however I don't want any of the old files. It would be great to be able to copy a directory and then paste only the folders, without any of the files, to a new location.
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

RalphM
Posts: 1935
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Post by RalphM »

There are two ways in XY to accomplish this:

1. If the structure is changing every now and then, right-drag the top folder of the structure to the new location and select "Create branches here" from the ctx menu, which does exactly what you asked for.

2. If the structure is always the same, you create that structure once in XY's application subfolder NewItems (i.e. C:\Programme\XYplorer\NewItems\) by using method 1. or manually.
Then, whenever you need to create that structure, just select it from the Edit/NewItems menu and it's created in the current location.
This option even allows you to store certain files within that structure template, that are created with the structure every time as well.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Post by lukescammell »

Bonus!

Very glad it's already here. Just takes time to actually find half the stuff you can do with XY, I'm never sure whether to post a wish or a request for a tip...

Out of interest, what is the difference between the "Branches" and "Folders" option? It seems to do the same thing for me.
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

admin
Site Admin
Posts: 60624
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

lukescammell wrote:Bonus!

Very glad it's already here. Just takes time to actually find half the stuff you can do with XY, I'm never sure whether to post a wish or a request for a tip...

Out of interest, what is the difference between the "Branches" and "Folders" option? It seems to do the same thing for me.
Branches = Folders with all their subfolders (recursing the whole branch)
Folders= Folders without any subfolders, just the folders

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Post by lukescammell »

Thanks for that :)
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

zridling
Posts: 140
Joined: 29 Jul 2006 06:12
Location: Chicago, US
Contact:

Post by zridling »

Yes, that clears up the distinction for me, too. I had conflated the two (branches and folders).
- Zaine Ridling, The Great Software blog

admin
Site Admin
Posts: 60624
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

zridling wrote:Yes, that clears up the distinction for me, too. I had conflated the two (branches and folders).
While "branch" fits nicely into the tree metaphor, "folder" does not. Technically it's called a "node" which neither is part of a sane tree, I think.

Thanks for reading a fruitless (ah, tree metaphor!) posting! :wink:

Clippy
Posts: 3
Joined: 07 Nov 2023 19:06

Re: Copy Directory Structure

Post by Clippy »

I'm trying to accomplish the same thing as the OP. I've tried both methods of using the "Create branches here" as well as the 'NewItems' method. While both create the directory structure correctly, neither seems to keep the saved folder view that the original has. In my case the top level folder has 3 subfolders that should be displayed with a "Details" view, and then when selecting any of the subfolders the view should be "Thumbnails #3".

Is there a way to keep the folder view settings intact as well? A bonus would be if it also recreated the sort criteria for each of the original folders.

highend
Posts: 13333
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Copy Directory Structure

Post by highend »

Try to use folder view settings (ofc with relative paths). Anything else won't work
One of my scripts helped you out? Please donate via Paypal

Clippy
Posts: 3
Joined: 07 Nov 2023 19:06

Re: Copy Directory Structure

Post by Clippy »

highend wrote: 07 Nov 2023 19:53 Try to use folder view settings (ofc with relative paths). Anything else won't work
I did save the folder view settings for each of the folders in the 'template' folder before using either the 'Create Branches Here' or the 'NewItems' methods but that doesn't work. Or are you talking about something else?

highend
Posts: 13333
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Copy Directory Structure

Post by highend »

Show a screenshot of that definition and the folder structure as well?
One of my scripts helped you out? Please donate via Paypal

Clippy
Posts: 3
Joined: 07 Nov 2023 19:06

Re: Copy Directory Structure

Post by Clippy »

highend wrote: 07 Nov 2023 20:02 Show a screenshot of that definition and the folder structure as well?
Thanks for the help!

I'm not sure what the "definition" is but maybe it's this?
1.jpg
1.jpg (52.92 KiB) Viewed 341 times
2.jpg
2.jpg (43.89 KiB) Viewed 341 times
So I created the "Template" folder in C:\Users\Dave\AppData\Roaming\XYplorer\NewItems\

I then saved the folder view for the "Template" with the view as "Details". then for the three subfolders, "Top Camera", "Back Camera" and "Microscope" I went into each and changed the view to "Thumbnails #3" and saved the view for each folder.

Then I tried both right click and dragging the 'Template' folder to a new drive and selected "Create Branches Here". When I do that all of the subfolders (Top Camera, etc) all have a view of "Details", not "Thumbnails #3". The same happens if I use the right click "New Items" and select the "Template Folder".
Last edited by Clippy on 08 Nov 2023 23:07, edited 1 time in total.

highend
Posts: 13333
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Copy Directory Structure

Post by highend »

Ofc this doesn't work, you've used fixed paths for those folder view definitions. As I already said, they must use relative paths

E.g.:
*\Microscope, *\Top Camera, etc. so that they are applied to all those copied directory structures...
One of my scripts helped you out? Please donate via Paypal

Clippy
Posts: 3
Joined: 07 Nov 2023 19:06

Re: Copy Directory Structure

Post by Clippy »

Thanks, that sorted it.

yuyu
Posts: 114
Joined: 19 Jun 2018 12:40

Re: Copy Directory Structure

Post by yuyu »

lukescammell wrote: 23 Oct 2006 11:45 copy the directory structure of a project
Paste Special > Paste Folder Structure

Post Reply