I have a large and deep directory structure and I want to copy only some specific subfolders. Like for example, copy only (minimatch notation) ./foo/bar/baz/**/* and ./bar/foo/**/* but exclude everything else.

I know I can specify what to copy in the copy dialog (F5) and I can exclude some folders in the fied "Only files of this type:" using | MyFolderToExclude\, but that doesn't help.

I this is not possible with total commander, what would be another esay and quick way to this (e.g. using a powershell or xcopy)?

  • You could use the -depth parameter on get-childitem. I'm not sure this is exactly what you are looking for though? get-childitem c:\foo -recursive -depth 2. I think -depth came around in PowerShell 3 or 4. As long as you have those versions, you should be ok. – Tim Haintz Jan 3 '17 at 7:13
  • Unfortunately -depth doesn't work. The folders I want to copy have arbitary depths. And I do want to omit other folder with the same depth. – bitbonk Jan 3 '17 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.