Board logo

标题: [文件管理] 批处理版ie临时图片收集(进度版) [打印本页]

作者: foxJL    时间: 2007-11-15 20:28     标题: 批处理版ie临时图片收集(进度版)

  1. @echo off
  2. ::收集后的图片在"C:\Documents and Settings\photos"文件夹内,并且按日期分档.
  3. mode con cols=86 lines=8
  4. title ie临时图片收集(进度版)
  5. color 9e
  6. set nonum=0
  7. set yesnum=0
  8. del %temp%\copys.ini>nul 2>nul
  9. setlocal EnableDelayedExpansion
  10. set/p delnum=过滤图片文件大小(小于,单位KB,如:20):
  11. set /a deletenum=delnum*1024
  12. if not exist "c:\Documents and Settings\photos\." md "c:\Documents and Settings\photos\"
  13. for /f "tokens=*" %%i in ('dir "%userprofile%\Local Settings\Temporary Internet Files\*.jpg","%userprofile%\Local Settings\Temporary Internet Files\*.gif" /s/b') do (
  14.     if %%~zi lss %deletenum% (
  15.     for /l %%c in (1,1,45) do (set/p=<nul)
  16.     set /a nonum+=1
  17.     set/p=放弃 !nonum! 个文件,可以复制 !yesnum! 个文件.<nul
  18.     ) else (
  19.     for /l %%c in (1,1,45) do (set/p=<nul)
  20.     set /a yesnum+=1
  21.     echo %%~ti "%%i">>%temp%\copys.ini
  22.     set/p=放弃 !nonum! 个文件,可以复制 !yesnum! 个文件.<nul
  23.     )
  24. )
  25. set /a copynum=yesnum/80+1
  26. set /a copygd=yesnum/copynum
  27. echo.&echo.&echo.&set /p=    <nul
  28. for /l %%i in (1,1,!copygd!) do set /p=^<<nul
  29. for /l %%i in (1,1,!copygd!) do set /p=<nul
  30. for /f "tokens=1,2,*" %%j in (%temp%\copys.ini) do (
  31.     if not exist "c:\Documents and Settings\photos\%%j\." md "c:\Documents and Settings\photos\%%j\"
  32.         copy %%l "c:\Documents and Settings\photos\%%j\" /y >nul 2>nul
  33.         call :xs
  34.         set /a cf+=1
  35.         title 已经复制 !cf! 个文件...
  36. )
  37. echo.&echo.&echo.&echo.    已经复制完成!
  38. ping -n 5 127.1>nul&start "" "C:\Documents and Settings\photos"&pause>nul&exit
  39. :xs
  40. set /a n+=1
  41. 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://bathome.net./) Powered by Discuz! 7.2