Is there a way to copy directory structure?
Moderators: white, Hacker, petermad, Stefan2
Is there a way to copy directory structure?
I would like to duplicate the directory structure from one branch to another. I don't want to copy any files, just the structure itself. Can TC do this?
- sqa_wizard
- Power Member
- Posts: 3864
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Re: Is there a way to copy directory structure?
The (TC) standard way is pretty straigthforward, although it may seem tricky: 1. Select the top level directories to be copied - 2. Click Copy/press F5 - 3. Click on the button having '+' label next to the type selector listbox (bottom) (or select a previously created directory template name from the listbox and continue on step 11) - 4. Enter asterisk (*) into the 'Search for' textbox - 5. Click on/select the Advanced tab - 6. Check 'Attributes' checkbox - 7. Check 'Directories' checkbox - 8. Select 'Save' button - 9. Enter 'DirsOnly' (or any other label at your will) into the template name textbox - 10. Click OK - 11. Click OK ... wait until done, normally pretty soon depending on the direcory tree size.
That's all. Worth to NOTE that the steps 4-10 can be done separately creating a template for directories only, which can be useful in other cases also. In such cases just that template name needs to be selected for the manipulation.
[MTAG]
That's all. Worth to NOTE that the steps 4-10 can be done separately creating a template for directories only, which can be useful in other cases also. In such cases just that template name needs to be selected for the manipulation.
[MTAG]
Re: Is there a way to copy directory structure?
Andante:
Select dirs to copy; Hit F5; In "files of this type", write
Hit OK. Done.
Select dirs to copy; Hit F5; In "files of this type", write
Code: Select all
|*.*
Re: Is there a way to copy directory structure?
Just type .. in the "file types" (.. = folder 'file type')
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
Re: Is there a way to copy directory structure?
No, ".." is not a folder file type, ".." is just a reserved file system, so it causes TC to skip all files (just like as sqa_wizard's way does and which is usually used by me), but folders can't be skipped so only folders are copied.
Re: Is there a way to copy directory structure?
Elegant!Just type .. in the "file types"
Re: Is there a way to copy directory structure?
It doesn't work for me. It copies all the contents. I just want to copy the top structure dirs no sub structures.palos wrote: ↑2019-03-19, 10:37 UTC The (TC) standard way is pretty straigthforward, although it may seem tricky: 1. Select the top level directories to be copied - 2. Click Copy/press F5 - 3. Click on the button having '+' label next to the type selector listbox (bottom) (or select a previously created directory template name from the listbox and continue on step 11) - 4. Enter asterisk (*) into the 'Search for' textbox - 5. Click on/select the Advanced tab - 6. Check 'Attributes' checkbox - 7. Check 'Directories' checkbox - 8. Select 'Save' button - 9. Enter 'DirsOnly' (or any other label at your will) into the template name textbox - 10. Click OK - 11. Click OK ... wait until done, normally pretty soon depending on the direcory tree size.
That's all. Worth to NOTE that the steps 4-10 can be done separately creating a template for directories only, which can be useful in other cases also. In such cases just that template name needs to be selected for the manipulation.
[MTAG]
Re: Is there a way to copy directory structure?
For to copy the empty folder structure only, without any files, use
sqa_wizard wrote: ↑2018-03-14, 23:03 UTC Just select the folders you want to copy and enter at "Only files of this type" a name which does not exist at all (e.g. asdfasdf)
This will copy folders without any file
For to copy the empty TOPLEVEL folder structure only, without any files, use
- a script (TC will provide parameters for selected folders and target folder)
- or an WCX "packer"-plugin
like the "DirCopy" plugin from François GANNIER which can do what you want: copying one or more top level folders only.
https://totalcmd.net/plugring/dircopy.html
How to use an WCX "packer"-plugin
- download the plugin
- with TC locate the archive and double click on it
- for WCX-plugin assign during the setup a "file type" (2 to 10 chars), here f.ex.: "DirCopy"
- use an WCX-plugin by pressing Alt+F5 to open the "Files > Pack..." dialog.
- select the wanted plugin (your chosen "file type") from the Packer-drop-down combobox above the [Configure]-button.
- some plugin allow configuration via the [Configure]-button or its settings ini file, see the read.me file of the plugin.
Re: Is there a way to copy directory structure?
Thank you! How do I compile a script with help of TC parameters? I tried to read the instructions on how to install the plugin but I don't know how use it.
PowerShell: Is there a way to copy directory structure?
TC provide parameter for selected files or folders\
For example:
"%L" : Create a list file in the TEMP directory with the names of the selected files and directories.
"%T" : Path in Target panel
For parameters see > Help "Operation > Menus > Menu: Configuration > Change Button Bar > Configuration - Change button bar".
With such parameters you can feed your script (MS-Dos Batch/PowerShell/VBS/AutoHotkey/...)
For your issue: Create selected folders in target panel
Code: Select all
Command: cmd /K
Parameters: FOR /F "tokens=*" %%x IN (' type "%F" ') DO @echo MD "%T%%x"
Start path:
Icon file: WCMICONS.DLL
Tooltip: Script to do smtg with each file from "%F"
NOTE: To enable the above command for real work, change "cmd /k" to "cmd /c" and remove the command "ECHO".
Note: Batch works best with basic english ansi/ascii letters only. For umlauts or unicode better use VBS or PoSh.
Or try with another code page like "Parameters: chcp 1252 & FOR /F . . . ...." for windows CP or chcp 65001 for UTF-8 CP
Code: Select all
Command: PowerShell -NoExit -NoProfile
Parameters: Get-Content '%F' | ForEach{ New-Item -Path '%T' -Name "$_" -ItemType "directory" }
Start path:
Icon file: PowerShell --or-- WCMICONS.DLL
Tooltip: Script to do smtg with each file from "%F"
Other people also read this
viewtopic.php?f=3&t=52425