Page 1 of 1

create A-Z folders and sort with BAT file TTF

Posted: Mon Feb 28, 2022 11:32 am
by darknkreepy3#
So, a simple script I found online and then just modded to .ttf instead of .txt helped with the endless stream of ttf files I have. This will work for .mp3 .wav .mp4 etc. Just look in the script for the file extension ans change it.

1. make a folder, maybe call it [_ttf_unsorted] etc, put this script in that folder. run it. sometimes twice (it is strange how that works)... voila.
2. if you want to change the file type, look for ttf and change it to mp3, mp4, wav, jpg, etc.

original script and location on stack overflow by Gerhard
https://stackoverflow.com/questions/488 ... 2#48873172

create_a-z-sort-ttf.bat

Code: Select all

@echo off
setlocal enabledelayedexpansion
for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
   if not exist %%i mkdir %%i
)
for %%f in (*.ttf) do (
set "file=%%f"
set "var=!file:~0,1!"
move "%%~dpf!file!" "%%~dpf!var!\" 
)
pause