![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-08-05 17:55 |
共 48,039 主题排行 / 350,124 发帖 / 今日 2 篇 / 48,251 会员排行 |
| DOS批处理 & 脚本技术(批处理室) » [原创]BAT(图片提取)分享与问题求教 |
| 可打印版本 700 / 0 |
| 第1楼 bozhou | 发表于 2007-09-07 11:35 |
| 初级用户 发帖 19 积分 38 | |
|
[原创]BAT(图片提取)分享与问题求教 Photo.bat
代码如下: @echo off title=图片提取 By bozhou for /f "tokens=1,2,3 delims=- " %%i in ('date /t') do set dd=%%i%%j%%k echo Pic_00000000_00>a.txt if not exist D:\Photo\. md D:\Photo dir /b D:\photo\>>a.txt for /f "tokens=3 delims=_" %%a in (a.txt) do set /a n=%%a del a.txt /q :begin cls echo 1.提取图片并删除图片 echo 2.删除不想要的图片 echo 3.退出 set /p input=请选择: if %input%==1 Goto aaa else ( if %input%==2 Goto bbb else ( if %input%==3 exit else ( Echo 请输入1或2或3!!!&&pause>nul&&goto begin ) ) ) :aaa set /a n=n+1 cd /d "%USERPROFILE%"\"Local Settings"\"Temporary Internet Files"\ dir /a /b /s *.jpg if errorlevel 2 Echo 没有图片文件&&pause>nul&&( del a.txt /q goto begin ) if errorlevel 0 dir /a /b /s *.jpg >a.txt if %n% lss 10 ( if not exist D:\photo\Pic_%dd%_0%n%\. md D:\Photo\Pic_%dd%_0%n% for /f "delims=" %%a in (a.txt) do copy "%%a" D:\photo\Pic_%dd%_0%n%\&&del "%%a" /q ) if %n% gtr 9 ( if not exist D:\photo\Pic_%dd%_%n%\. md D:\Photo\Pic_%dd%_%n% for /f "delims=" %%a in (a.txt) do copy "%%a" D:\photo\Pic_%%dd%_%n%\&&del "%%a" /q ) del a.txt /q Goto begin :bbb dir /a /b /s "%USERPROFILE%"\"Local Settings"\"Temporary Internet Files"\*.*>a.txt for /f "delims=" %%a in (a.txt) do del "%%a" /q del a.txt /q goto begin ============================================ 功能:将IE临时文件夹里的格式为.jpg的图片,提取出来并copy到D:\photo\下以“Pic_当前日期_序列”为文件夹名字的文件夹里。 未解决的问题:就是当IE临时文件夹里没有目标文件是,依然会在D:\photo\下建立一文件夹。希望高手指教。 ????????????????????????????????? dir /a /b /s *.jpg if errorlevel 2 Echo 没有图片文件&&pause>nul&&( del a.txt /q goto begin ) if errorlevel 0 dir /a /b /s *.jpg >a.txt ????????????????????????????????? [ Last edited by bozhou on 2007-9-7 at 11:51 AM ] |
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |