标题: [文件管理] 批处理版ie临时图片收集(进度版) [打印本页]
作者: foxJL 时间: 2007-11-15 20:28 标题: 批处理版ie临时图片收集(进度版)
- @echo off
- ::收集后的图片在"C:\Documents and Settings\photos"文件夹内,并且按日期分档.
- mode con cols=86 lines=8
- title ie临时图片收集(进度版)
- color 9e
- set nonum=0
- set yesnum=0
- del %temp%\copys.ini>nul 2>nul
- setlocal EnableDelayedExpansion
- set/p delnum=过滤图片文件大小(小于,单位KB,如:20):
- set /a deletenum=delnum*1024
- if not exist "c:\Documents and Settings\photos\." md "c:\Documents and Settings\photos\"
- for /f "tokens=*" %%i in ('dir "%userprofile%\Local Settings\Temporary Internet Files\*.jpg","%userprofile%\Local Settings\Temporary Internet Files\*.gif" /s/b') do (
- if %%~zi lss %deletenum% (
- for /l %%c in (1,1,45) do (set/p=<nul)
- set /a nonum+=1
- set/p=放弃 !nonum! 个文件,可以复制 !yesnum! 个文件.<nul
- ) else (
- for /l %%c in (1,1,45) do (set/p=<nul)
- set /a yesnum+=1
- echo %%~ti "%%i">>%temp%\copys.ini
- set/p=放弃 !nonum! 个文件,可以复制 !yesnum! 个文件.<nul
- )
- )
- set /a copynum=yesnum/80+1
- set /a copygd=yesnum/copynum
- echo.&echo.&echo.&set /p= <nul
- for /l %%i in (1,1,!copygd!) do set /p=^<<nul
- for /l %%i in (1,1,!copygd!) do set /p=<nul
- for /f "tokens=1,2,*" %%j in (%temp%\copys.ini) do (
- if not exist "c:\Documents and Settings\photos\%%j\." md "c:\Documents and Settings\photos\%%j\"
- copy %%l "c:\Documents and Settings\photos\%%j\" /y >nul 2>nul
- call :xs
- set /a cf+=1
- title 已经复制 !cf! 个文件...
- )
- echo.&echo.&echo.&echo. 已经复制完成!
- ping -n 5 127.1>nul&start "" "C:\Documents and Settings\photos"&pause>nul&exit
- :xs
- set /a n+=1
- if !n! EQU !copynum! ((set n=0)&(set /p=^><nul)&goto :eof)
复制代码
作者: novaa 时间: 2007-11-16 10:32 标题: 对语句中FOR的疑问
for /f "tokens=*" %%i in ('dir "%userprofile%\Local Settings\Temporary Internet Files\*.jpg","%userprofile%\Local Settings\Temporary Internet Files\*.gif" /s/b') 这句不懂
我测试的时候总错误
我测试的代码
for /f "delims=" %%a in ('dir "f:\图片\*.jpg" ') do (
echo %%a
pause
)
作者: 52mn998 时间: 2009-3-27 17:45
对IE 7有用吗? 我来试试看
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |