S
S
Sergiy Marishchuk2021-04-10 08:20:27
cmd/bat
Sergiy Marishchuk, 2021-04-10 08:20:27

How to move files from sub-folders to sub-folders?

How to move jpg and png files up a level. Working from folder IN
There are files with the same name! It is desirable for them to add the suffix _EN _RU

6071350e8c1f9401186277.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pumpkinm, 2021-04-10
@pumpkinm

setlocal EnableDElayedExpansion
del movefiles.bat
set ext=jpg
for /r %%i in (*.%ext%) do (
  set newname=%%i
  echo %%i| find /I "\English\" && ( set newname=!newname:\English\=\!& set newname=!newname:~0,-4!_EN.%ext%)
  echo %%i| find /I "\Russian\" && ( set newname=!newname:\Russian\=\!& set newname=!newname:~0,-4!_RU.%ext%)
  echo move "%%i" "!newname!" >> movefiles.bat
)

After launch, you will get a movefiles.bat file , which will already move the files.
Why not immediately move? And to further control what goes where.
Then replace jpg with png and repeat.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question