[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文件管理] 批处理版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)
复制代码
1

评分人数

对语句中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
)
ㄗs:A good programming is 99% sweat and 1% coffee!--①個亾

============ >   hi.baidu.com/novaa   <============

TOP

对IE 7有用吗? 我来试试看

TOP

返回列表