标题: [文件操作] 好久不回来,分享个自己写的批处理相片整理工具 [打印本页]
作者: 林小七 时间: 2015-7-28 14:21 标题: 好久不回来,分享个自己写的批处理相片整理工具
好久不回来,分享个自己写的相片整理工具
这个是今天整理文件偶然发现的,就和大家分享下..
没有使用第三方exe.....存p,win7 win8 win10通用...
纪念下我曾经的bat吧. by:林小柒
论坛AV的画质,,,,,我也是醉了...- @echo off&&setlocal enableextensions
- title PhotosMoves By:Seven&&color 0D
- MODE CON COLS=64 LINES=15
- set mycolor="9ABCDEF"
- set "sevens=call :seven"&&set "end=@echo."
- set myName=%~n0
- if "%myName%" neq "se7en" (
- @echo. &&@echo.&&@echo 文件部分~损~坏,请将文件名修改为se7en后方可正常运行。
- @echo. &&%sevens% D " By@林小柒 QQ:"&&%sevens% 9 "9"&&%sevens% A "8"&&%sevens% B "5"&&%sevens% C "3"&&%sevens% D "9"&&%sevens% E "0"&&%sevens% F "9"&&%sevens% A "2"&&%sevens% C "7"
- rename %0 se7en.bat
- pause>nul
- %0&exit
- )
- :f
- goto main
- :k
- set /p select="请选择要处理的类型:"
- if "%select%" == "1" goto f1
- if "%select%" == "2" goto f2
- if "%select%" == "3" goto f3
- if "%select%" == "4" goto f4
- if "%select%" == "5" goto f5
- if "%select%" == "6" exit
- goto f
- :f1
- for /r %%a in ("*.jpg") do set "t=%%~ta"&&call :movesByDd "%%a" %%t%%
- goto :dels
- :f2
- for %%a in ("*.jpg") do set "t=%%~ta"&&call :movesByDd "%%a" %%t%%
- goto :dels
- :f3
- for /r %%a in ("*.jpg") do set "t=%%~ta"&&call :movesByMm "%%a" %%t%%
- goto :dels
- :f4
- for %%a in ("*.jpg") do set "t=%%~ta"&&call :movesByMm "%%a" %%t%%
- goto :dels
- :f5
- @echo 把这个文件放到你要处理相片的目录下运行>D:\help.txt
- @echo 会按照照相的日期生成文件夹并且按照日期对相片进行移动或者分类>>D:\help.txt
- start notepad.exe "D:\help.txt"
- goto k
- :dels
- for /f "delims=" %%s in ('dir /s /ad /b') do rd /q "%%s" 2>nul 1>nul
- del /f /q "C:\help.txt" 2>nul 1>nul
- goto f
- :movesByDd
- set dates=%2&&call set dates=%%dates:/=-%%
- md %dates% 2>nul 1>nul
- move %1 %dates%
- set /a p=p+1
- goto :eof
- :movesByMm
- set dates=%2&&call set dates=%%dates:/=-%%&&call set dates=%%dates:~0,7%%
- md %dates% 2>nul 1>nul
- move %1 %dates%
- set /a p=p+1
- goto :eof
- :main
- cls
- %sevens% E "┌─────────────────────────────┐"&&%end%
- %sevens% E "│"&&%sevens% C " 相片分类工具"&&%sevens% E " │"&&%end%
- %sevens% E "│"&&%sevens% A " 1.分类目录下所有相片(按天)"&&%sevens% E " │"&&%end%
- %sevens% E "│"&&%sevens% A " 2.分类当前目录下相片(按天)"&&%sevens% E " │"&&%end%
- %sevens% E "│"&&%sevens% A " 3.分类目录下所有相片(按月)"&&%sevens% E " │"&&%end%
- %sevens% E "│"&&%sevens% A " 4.分类当前目录下相片(按月)"&&%sevens% E " │"&&%end%
- %sevens% E "│"&&%sevens% A " 5.超级详细的帮助文档"&&%sevens% E " │"&&%end%
- %sevens% E "│"&&%sevens% A " 6.退出"&&%sevens% E " │"&&%end%
- %sevens% E "│"&&%sevens% F " @Seven 2014-8-24"&&%sevens% E " │"&&%end%
- %sevens% E "│"&&%sevens% F " QQ:"&&%sevens% 9 "9"&&%sevens% A "8"&&%sevens% B "5"&&%sevens% C "3"&&%sevens% D "9"&&%sevens% E "0"&&%sevens% F "9"&&%sevens% A "2"&&%sevens% C "7"&&%sevens% E " │"&&%end%
- %sevens% E "└─────────────────────────────┘"&&%end%
- if defined p echo ok.成功的分类了 %p% 张相片&&set /a p=0
- set files=nul
- set select=nul
- if not defined "%files%" set /p files="请拽入要处理的目录 6退出:"
- if "%files%" equ "6" exit
- if not exist "%files%" @call %sevens% A 文件路径不存在,任意键继续&&pause>nul&&goto main
- for %%a in ("%files%") do set "b=%%~aa"
- if defined b (if %b:~0,1% neq d (@echo 拽入的不是目录,任意键继续&&pause>nul&&goto main ))
- cd /d "%files%"
- goto k
- :seven
- pushd "%temp%"&set/p= <nul>"%~2"&findstr /a:%~1 .* "%~2" nul&del "%~2"&popd
复制代码
作者: 林小七 时间: 2016-2-29 10:01
回来看看~~~~~~
作者: 别喜欢哥 时间: 2016-5-31 12:17
大神有没有一键整理全盘图片jpep格式的然后默认输出指定文件夹
作者: 523066680 时间: 2016-10-22 13:01
楼主现在从事哪方面了?
作者: 林小七 时间: 2016-12-20 17:09
回复 4# 523066680
数据挖掘分析方面 主要使用java scala python....
作者: apr 时间: 2016-12-21 15:34
这个好
最好能批处理一份低分辨率照片的文件夹,这样选照片会方便一些
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |