复制粘贴到记事本,另存为xx.bat,编码选ANSI,跟要处理的文件放一起运行
@echo off
rem 将文件剪切/移动进(与文件名相同的)同名文件夹里
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
cd /d "%~dp0"
for /f "delims=" %%a in ('dir /a-d/b') do (
if /i "%%~nxa" neq "%~nx0" (
if not exist "%%~na\" (md "%%~na\")
echo;"%%a" --^> "%%~na\"
move "%%a" "%%~na\"
)
)
:end
echo;%#% +%$%%$%/%@% %z%
pause
exit
文件名字和文件夹名字对应是吧?你试试这个
@echo off
for %%i in (D:\新建文件夹\*txt) do echo %%~ni >>1.txt
for /f %%i in (1.txt) do move D:\新建文件夹\%%i.txt D:\新建文件夹\%%i
del 1.txt