Answer the question
In order to leave comments, you need to log in
How to copy folders to an unconditional path using a bat file?
There is such a folder structure.
And you need to copy each res folder with all its contents (folders, subfolders and files) into the nightmode folders located next to them. Those. there is a res folder in the com.miui.cloudservice folder, then copy it to com.miui.cloudservice\nightmode. Found the res folder. Copied its contents. Created a nightmode folder next to it. Pasted the contents of the res folder into it. Found the following res folder - repeated the steps.
The Bat file is planned to be transferred and run in the Russsia, Moldova, etc. folders. How to write such a bat file?
Answer the question
In order to leave comments, you need to log in
Approximately so
for /r "d:\каталог\для\обработки" %%I in (res) do if exist "%%I\" xcopy "%%I" "%%I\..\nightmode\" /s
It didn't quite work that way. I didn't describe correctly at first. You need to copy not just the contents of the res folder, but the res folder itself. Those. the final path should be \nightmode\res\subdirectory\files , but now it turned out only \nightmode\subdirectory\files without the res folder.
Went through the crutch. I added the res1 folder after the nightmode folder, and then massively renamed all res1 to res through the totalcommander.
@ECHO OFF
::
for /r "d:\каталог\для\обработки" %%I in (res) do if exist "%%I\" xcopy "%%I" "%%I\..\nightmode\res1\" /s
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question