windows - Using Xcopy or other to copy similar folders within directory -


i have 1 directory several folders names 'mapas_10452; mapas_21685; mapas_22731' , os on... inside every folder have several folders, want copy contents of 1 of them, folder 'novos'.

is possible use xcopy, batch file or other option copy contents of folder want, evey folder 'mapas_xxxxx' have ?

the result be: mapas_10452/novos mapas_21685/novos mapas_22731/novos

  1. as for /? says should put path in parentheses.
  2. add wildcard enumerate folder contents: *
  3. use name of parent folder construct new path: %%~nf
  4. check if novos subfolder exists.
  5. for flexibility use %userprofile% system variable
  6. use xcopy /s , add trailing slash second argument indicate it's folder
  7. [optional] use doubleqoutes process file/folder names spaces

for %%f in ("%userprofile%\desktop\mapassaas\*") (     if exist "%%f\novos" (         xcopy /s "%%f\novos" "%userprofile%\desktop\folder\%%~nf\novos\\"     ) ) 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -