xcopy通配符源文件夹名称到目标

xcopy通配符源文件夹名称到目标

本文介绍了xcopy通配符源文件夹名称到目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从通配符源文件夹复制到目标文件夹:

I want to copy from a wildcard source folder to a destination folder:

xcopy a:\parentfolder\n* x:\parentfolder

因此,仅应将以"n"开头的文件夹复制到目标位置.

Only folders starting with "n" should therefore be copied to the destination.

任何帮助实现此目的的方法将不胜感激.

Any help to get this working would be much appreciated.

推荐答案

for /f "delims=" %%a in ('dir /b/ad "a:\parentfolder\n*" ') do xcopy "a:\parentfolder\%%a\*" x:\parentfolder\

正如您所拥有的,XCOPY假定n*是一个文件规范,否则无法告诉它.

As you have it, XCOPY assumes that n* is a filespec, and there's no way to tell it otherwise.

这篇关于xcopy通配符源文件夹名称到目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 01:23