Reputation: 1
I am trying to get a cmd to extract filenames (around 400 plus) from a directory and then create individual folder for each file name in a separate directory.
SET Count=0
FOR %%A IN (%DIRTOSARCH%\*.xml) DO SET /A Count += 1
ECHO.%Count%
Above code is: get count of .xml files in a folder and then I want to create folder for each filename in separate folder.
Upvotes: 0
Views: 188
Reputation: 5805
FOR /F "delims=" %%A IN ('DIR /B /A-D "%DIRTOSEARCH%\*.xml"') DO (MD "%%a.dir" & COPY "%DIRTOSEARCH%\%%a" "%%a.dir")
Upvotes: 1