按文件名称自动分类代码1-
- @echo off
- title 文件分类@fmr520 2008/4/20
- mode con cols=45 lines=15
- color 2f
- call :shuoming
- set "mulu=:"
- set "houzhui=:"
- cls
- setlocal EnableDelayedExpansion
- :ml_
- cls
- echo\&echo. 文件夹格式是 d:\abc\mp3
- echo\&echo. 必须带有 \ 否则输入无效
- echo\&echo. ( .\ 表示当前文件夹 )
- echo\&echo.
- set /p mulu=将要操作的文件夹放到这里:
- set mulu=%mulu:"=%
- if "%mulu%" == ":" goto ml_
- if "%mulu%" == ".\" goto hz_
- if not "%mulu:~2,1%" == "\" call :cuo "%mulu%"
- :hz_
- cls
- echo\&echo.程序运行中...
- ping 127.1 -n 1 >nul
- for /f "tokens=*" %%a in (list.ini) do (set vaa=%%a
- pushd "%mulu%"
- for /f "tokens=*" %%i in ('dir/b ^|findstr /i "!vaa!" ') do (
- if not exist !vaa! md !vaa!
- move "%%i" !vaa!
- )
- )
- cls
- echo\echo. 完成!
- pause>nul&exit
- :cuo
- echo\&echo. 你输入的 %1 无效!
- pause>nul
- if %1 == "%houzhui%" goto hz_
- if %1 == "%mulu%" goto ml_
- goto ml_
- :shuoming
- echo 把你要分类的文件名写进list.ini这个文件里,一行只能写一个文件名,否则会出错。 >>说明.txt
- start 说明.txt
- ping 127.1 -n 2 >nul
- del 说明.txt /q/f/a
- goto :eof
复制代码 按文件名称自动分类代码2-
- @echo off
- title 文件分类@fmr520 2008/4/19
- mode con cols=45 lines=15
- color 2f
- set "mulu=:"
- set "houzhui=:"
- cls
- setlocal EnableDelayedExpansion
- :ml_
- cls
- echo\&echo. 文件夹格式是 d:\abc\mp3
- echo\&echo. 必须带有 \ 否则输入无效
- echo\&echo. ( .\ 表示当前文件夹 )
- echo\&echo.
- set /p mulu=将要操作的文件夹放到这里:
- set mulu=%mulu:"=%
- if "%mulu%" == ":" goto ml_
- if "%mulu%" == ".\" goto hz_
- if not "%mulu:~2,1%" == "\" call :cuo "%mulu%"
- :hz_
- cls
- echo\&echo.输入要分类的后缀名,如 *.mp3 *.swf *.txt 或 *
- echo\&echo.可以同时输入多个后缀如 *.mp3 *.swf *.txt
- echo\&echo.输入 * 会对该目录下的全部文件分类
- echo\&echo.
- set /p houzhui=输入要分类的后缀名:
- if "%houzhui%" == ":" goto hz_
- if not "%houzhui:~0,1%" == "*" call :cuo "%houzhui%"
- cls
- echo\&echo. 程序正在运行中...
- ping 172.1 /n 1 >nul
- pushd "%mulu%"
- for /f "tokens=1* delims=-,.; " %%a in ('dir/b %houzhui%') do (
- set var=%%~na
- if not exist !var! md !var!
- move "%%a?%%b" !var!
- )>nul 2>nul
- cls
- echo\echo. 完成!
- pause>nul&exit
- :cuo
- echo\&echo. 你输入的 %1 无效!
- pause>nul
- if %1 == "%houzhui%" goto hz_
- if %1 == "%mulu%" goto ml_
- goto ml_
复制代码 链接: https://pan.baidu.com/s/1GmoENYtoAWKdbOdiXV2SYg?pwd=eb2q |