I have this .torrent file list example inside a directory
Le Rane del Mare 1951.torrent
Left Behind - La Profezia 2014.torrent
Lo straordinario viaggio di T.S. Spivet.torrent
Maleficent 2014 [dvd rip].torrent
Mandingo (1975).torrent
Maurice - Versione Integrale 1987.torrent
I want a .bat. This bat must to generate folders extracting year from file name like
1951
2014
1975
1987
Then I want to move files inside folders previously created like this
Le Rane del Mare 1951 --> 1951
Left Behind - La Profezia 2014 --> 2014
Maleficent 2014 --> 2014
Mandingo 1975 --> 1975
Maurice - Versione Integrale 1987 --> 1987
I use Win7
I use this code BUT i must create folder list before. I want create with batch, not manually
@echo off
setlocal enabledelayedexpansion
pushd %1
for /F "USEBACKQ tokens=*" %%a in (`dir /b /a:-d`) do (
set "_file=%%a"
for /D %%b in (*) do (
if NOT "x!_file:%%b=!" == "x!_file!" (
move "%%a" "%%b"
)
)
)
popd