@echo off setlocal enabledelayedexpansion rem 设置要查找的关键字列表 set "keywords=Atypical Caustic Cloud Crack Decal Dirt Electric Environ Explosion Fire Flare FLowmap Glow Grid Hit Ice KnifeTrail LightBeam Line Mask Noise Other Rain Ring Shine Shockwave Smoke Spatter Spell Symbol Trail Water" rem 设置目标文件夹路径 set "target_folder=D:\All WX\All UE\Project\c_101\pic" rem 检查并创建Other文件夹 if not exist "%target_folder%\Other" mkdir "%target_folder%\Other" rem 遍历目标文件夹中的所有文件 for %%f in ("%target_folder%\*.*") do ( set "fileMoved=0" rem 遍历每个关键字 for %%k in (%keywords%) do ( if !fileMoved! equ 1 ( rem 如果文件已移动,跳出内层循环 break ) rem 检查文件名中是否包含关键字(不区分大小写) echo %%~nxf | findstr /i "%%k" >nul if %errorlevel% equ 0 ( rem 检查是否存在以关键字命名的文件夹,如果不存在则创建 if not exist "%target_folder%\%%k" mkdir "%target_folder%\%%k" rem 移动文件到关键字文件夹 move "%%f" "%target_folder%\%%k" rem 设置标志变量,表示文件已移动 set "fileMoved=1" ) ) rem 如果文件没有被移动,则移动到Other文件夹 if !fileMoved! equ 0 ( move "%%f" "%target_folder%\Other" ) ) echo 完成! pause