不清楚你的实际文件/情况,仅以问题中的样例/说明为据;以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI,跟要处理的文件放一起运行
echo off&cls
rem 根据文件名称创建同名文件夹并剪切/移动文件到该文件夹里
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
cd /d "%~dp0"
for /f "delims=" %%a in ('dir /a-d-h/b') do (
if /i "%%~nxa" neq "%~nx0" (
md "%%~na" 2>nul
echo;"%%a" --^> "%%~na\"
move "%%a" "%%~na\"
)
)
echo;%#% +%$%%$%/%_% %z%
pause
exit
echo off&cls
rem 根据文件名称创建同名文件夹并剪切/移动文件到该文件夹里
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
cd /d "%~dp0"
for /f "delims=" %%a in ('dir /a-d-h/b') do (
if /i "%%~nxa" neq "%~nx0" (
md "%%~na" 2>nul
echo;"%%a" --^> "%%~na\"
move "%%a" "%%~na\"
)
)
echo;%#% +%$%%$%/%_% %z%
pause
exit