iotalinen 当前离线
列兵
评分人数
TOP
set a=txt set b=JPG for /f "delims=" %%a in ('dir /b/a-d *.%a%') do if exist ".\%%~na.%b%" md ".\%%~na\" 2>nul&move "%%a" ".\%%~na\" 2>nul&move ".\%%~na.%b%" ".\%%~na\" 2>nul pause 复制代码
CrLf 当前离线
论坛巡查
@echo off for %%a in (*) do if %%~xa neq .$ ( set "na=%%~na" set "fa=%%~fa" setlocal enabledelayedexpansion for %%b in ("!na!*") do ( set /a n+=1 ) if !n!==4 ( md "!na!" move "!na!.*" "!na!\" endlocal ) else ( for %%b in ("!na!*") do ( endlocal ren "%%b" "%%b.$" ) ) ) ren * *.复制代码
@echo off&setlocal enabledelayedexpansion for %%a in (*.*) do ( set /a "\%%~na+=1" ) for /f "delims=" %%a in ('set \^|findstr "=4"') do ( set name=%%a md "!name:1~,-2!" move "!name:1~,-2!.*" "!name:1~,-2!\" )复制代码
apang 当前离线
上将
find 当前离线
少将
ArdentMan 当前离线
中尉
@Echo Off&SetLocal EnableDelayedExpansion Set /P Ext=输入指定的文件格式,各格式间请用空格格开: For /F "Delims=" %%i In ('Dir /a-d /b /on') Do ( If "!Str!" NEQ "%%~ni" ( If "!n!" EQU "4" If "!m!" EQU "4" ( Md "!Str!" Move "!Str!.*" "!Str!\" ) Set /A n=0,m=0 ) Set /a m+=1 For %%j In (%Ext%) Do If /i ".%%j" EQU "%%~xi" Set "Flag=a" If Defined Flag Set /A n+=1&Set "Flag=" Set "Str=%%~ni" ) Echo ok Pause>Nul复制代码
@echo off&setlocal enabledelayedexpansion for /f "delims=" %%a in ('dir /a-d /b') do ( if not defined .%%~na set ".%%~na=1" ) for /f "delims==" %%a in ('set.') do ( set "name=%%a" set "name=!name:~1!" dir /a-d "!name!.*"|findstr /c:"4 个文件">nul if "!errorlevel!"=="0" md "!name!"&move "!name!.*" "!name!\" )复制代码