directory - Create Folders By File Name With Delimiter -
i'm trying modify script magoo posted create folders based on file names , move associated files directories. there 2-4 files each instance same name different extensions. names delimited - (hyphen). these music files , therefore there multiple sets should moved folders titles reflect before delimiter.
@echo off setlocal set "sourcedir=f:\test" pushd "%sourcedir%" /f "delims=-" %%a in ( 'dir /b /a-d *.mp3 *.cdg *.plx ' ) ( set "filename=%%a" set "dirname=%%a" call :genmove ) popd goto :eof :genmove if "%dirname:~-1%" neq " " set "dirname=%dirname:~0,-1%"&goto genmove set "dirname=%dirname:~0,-1%" md "%dirname%" move "%filename%" ".\%dirname%\" goto :eof
my issues far:
- if define delimiter folders created files aren't moved.
- if eliminate delimiter files moved each set moved unique folder entire file name.
- using
*.*
in "dir" string didn't work, defined each extension
ant appreciated.
i figured out. added *
move "%filename%" ".\%dirname%\"
making move "%filename%*" ".\%dirname%\"
that moves collective files appropriate directories. still have wildcard in for /f
instead of defining each type of extension, works now.
Comments
Post a Comment