copy folder structure with files

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
totalcommanderuser
Junior Member
Junior Member
Posts: 5
Joined: 2020-06-04, 09:13 UTC

copy folder structure with files

Post by *totalcommanderuser »

hi
new here :)

i have multiple user profiles under c:\users

example :
c:\users\user1
c:\users\user2

under each one i have desktop/documents/download etc.

i'm looking for a way to copy only the desktop and it's content while preserving folder path structure

meaning
destination folder will be c:\backup

so i need to get to a situation where i have :
c:\backup\users\user1\desktop + it's content
c:\backup\users\user2\desktop + it's content

is there a syntax i can put in the copy action to do such a thing? or maybe other option in total commander? thank you
User avatar
solid
Power Member
Power Member
Posts: 747
Joined: 2004-08-09, 11:20 UTC

Re: copy folder structure with files

Post by *solid »

Select all folders with usernames and press F5.
In the copy dialog box hit F8 to bring the "Define selection" dialog box. There in the Plugins tab select Tc.Path.Contain and put 'Desktop' in the value box.
Save this selection, close the dialog box and select the item you just created from the dropdown menu. Press OK.
This will create the whole directory structure in the destination folder, but only the content of the desktop folders will be copied.
totalcommanderuser
Junior Member
Junior Member
Posts: 5
Joined: 2020-06-04, 09:13 UTC

Re: copy folder structure with files

Post by *totalcommanderuser »

cool, thank you. is it possible to only copy the desktop content without copying any other empty folder?
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: copy folder structure with files

Post by *nsp »

If you use a stricter definition for your "Desktop filter" you can just copy files on Desktop folder only.
Use Search:
  • in advanced, tick Attributea and set directory to empty.
  • On plugin tab, tick Search in plugin [in first rule,] use [tc] [path] [Regex] with:

    Code: Select all

    :\\users\\[^\\]+\\Desktop\\
  • Save to "usersDesktop"or any name you prefer you will be able to use it as >usersDesktop
You can check result in search from c:\users
totalcommanderuser
Junior Member
Junior Member
Posts: 5
Joined: 2020-06-04, 09:13 UTC

Re: copy folder structure with files

Post by *totalcommanderuser »

it's not working
maybe i did something wrong

screenshot 1 : https://pasteboard.co/JbWYOFC.png

screenshot 2 : https://pasteboard.co/JbWZeVX.png
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: copy folder structure with files

Post by *nsp »

From the screenshot, it seems to be OK.
From wich folder do you start ?
If you want to copy all users folder, you should start from C:\Users and if you want to get all users desktop, TC should run as Admin.
totalcommanderuser
Junior Member
Junior Member
Posts: 5
Joined: 2020-06-04, 09:13 UTC

Re: copy folder structure with files

Post by *totalcommanderuser »

oh i see. is there a way to start from c: and do f5 on the c:\users ?
that way, every time a new user comes, i wont have to do it manually
User avatar
solid
Power Member
Power Member
Posts: 747
Joined: 2004-08-09, 11:20 UTC

Re: copy folder structure with files

Post by *solid »

totalcommanderuser wrote: 2020-06-07, 05:43 UTC cool, thank you. is it possible to only copy the desktop content without copying any other empty folder?
AFAIK it is not possible without creating all other folders. Anyway it will copy only the content of the desktop folders.

Otherwise you can perform a search under the same criteria, feed the results in the listbox, select all and use TreeCopyPlus plugin. The plugin will retain the folder structure while copying found files.
Post Reply