D
D
dyacenko4292021-11-11 23:44:16
cmd/bat
dyacenko429, 2021-11-11 23:44:16

How to make a bat file to move folders to a folder?

For example, I have folder C:\1 and folder C:\2
In folder C:\1 there are folders with files, I need to move all folders from C:\1 to C:\2
MOVE /y D:\1\* D:\2
This code only moves files, but leaves folders untouched, but I need to move specific folders.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
wisgest, 2021-11-12
@dyacenko429

Use loop with key /D:
for /d %%D in (C:\1\*) do move "%%D" C:\2\

U
User700, 2021-11-12
@User700

See xcopy help. Perhaps what is needed.

P
pavelsha, 2021-11-12
@pavelsha

see
ROBOCOPY
https://docs.microsoft.com/en-us/windows-server/ad... Will
/mov or /move keys solve your problem?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question