Board logo

标题: 批处理提取IE缓存的指定文件 [打印本页]

作者: Wingl83    时间: 2008-8-2 15:10     标题: 批处理提取IE缓存的指定文件

  1. echo off
  2. set file_num=0
  3. cls
  4. echo 请选择要提取的文件类型
  5. echo 1(swf) 2(flv) 3(jpg) 4(gif) 5(mp3) 6(wma) 7(htm) 8(其它类型) 9(清除IE缓存)
  6. set /p type=
  7. if %type%==1 (set filetype=swf)
  8. if %type%==2 (set filetype=flv)
  9. if %type%==3 (set filetype=jpg)
  10. if %type%==4 (set filetype=gif)
  11. if %type%==5 (set filetype=mp3)
  12. if %type%==6 (set filetype=wma)
  13. if %type%==7 (set filetype=htm)
  14. if %type%==8 (echo 请输入文件类型,例如bmp
  15. set /p filetype=)
  16. if %type%==9 (goto :clear_cache)
  17. :select_del_or_not
  18. echo 提取后是否删除原文件?(y/n)
  19. set /p delornot=
  20. if %delornot%==y (goto startcopy)
  21. if %delornot%==n (goto startcopy)
  22. goto select_del_or_not
  23. :startcopy
  24. echo 正在提取文件,请稍候……
  25. md %filetype%
  26. for /f "delims=" %%i in ('dir "%userprofile%\Local Settings\Temporary Internet Files\*.%filetype%" /s/b') do if not exist "%CD%\%filetype%\%%~nxi" (
  27. copy /y "%%i" "%CD%\%filetype%\") else (
  28. call :copy_same_name_file "%%~i" "%%~ni" "%%~xi")
  29. if %delornot%==y (for /f "delims=" %%i in ('dir "%userprofile%\Local Settings\Temporary Internet Files\*.%filetype%" /s/b') do del /f/q "%%i")
  30. goto :eof
  31. :copy_same_name_file
  32. set file_n=%2
  33. set file_x=%3
  34. set /a file_num+=1
  35. ::变量file_num自加1
  36. echo %file_num%
  37. if not exist "%CD%\%filetype%\%file_n%_%file_num%%file_x%" (
  38. copy %1 "%CD%\%filetype%\%file_n%_%file_num%%file_x%">nul
  39. ) else call :copy_same_name_file %1 %2 %3
  40. set file_num=0
  41. goto :eof
  42. :clear_cache
  43. for /f "delims=" %%i in ('dir "%userprofile%\Local Settings\Temporary Internet Files\*.*" /s/b') do del /f/q "%%i"
  44. goto :eof
复制代码

试验了一下,发现若按9——清除IE缓存时并不能做到,我是一个小菜鸟,希望可以帮我修改一下。
作者: Batcher    时间: 2008-8-4 20:52

是倒数第二句的问题吧,这样可以吗?
  1. rd /s /q "%userprofile%\Local Settings\Temporary Internet Files\Content.IE5">nul 2>nul
复制代码

作者: Wingl83    时间: 2008-8-5 15:02

不清楚嘢,是将什么改成
  1. rd /s /q "%userprofile%\Local Settings\Temporary Internet Files\Content.IE5">nul 2>nul
复制代码
呢?
作者: Batcher    时间: 2008-8-5 23:14

2楼不是说了吗?倒数第二句^_^
作者: Wingl83    时间: 2008-8-6 00:35

不行嘢,加油……
作者: Batcher    时间: 2008-8-6 09:25

我行嘢,加油……
作者: Wingl83    时间: 2008-8-6 10:55

晕倒中……

[ 本帖最后由 Wingl83 于 2008-8-6 10:57 编辑 ]
作者: 52mn998    时间: 2009-3-27 18:39

晕晕哦,还是出错啊,我看了好久还是不知道那里有问题
作者: chinaweike    时间: 2009-10-22 12:40

太强了,能教教我吗?我才学的,行的话加我QQ:125350211,谢谢
作者: lxzzr    时间: 2009-10-22 18:07

还请楼主注明出处....




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2