Board logo

标题: 到IE缓存挖掘宝贝(有自动重命名功能) [打印本页]

作者: pooloo     时间: 2007-9-28 17:04    标题: 到IE缓存挖掘宝贝(有自动重命名功能)

::自动重命名功能---IE cache里好多重名资源啊,原来一copy就覆盖了,现在好了,可以自动重命名了,哈哈
::key words: Internet 临时文件夹 提取资源 IE临时文件夹 批量提取图片 删除 批处理 清除
echo off
set file_num=0
cls
echo 请选择要提取的文件类型
echo  1(swf) 2(flv) 3(jpg) 4(gif) 5(mp3) 6(wma) 7(htm) 8(其它类型) 9(清除IE缓存)
set /p type=
if %type%==1 (set  filetype=swf)
if %type%==2 (set  filetype=flv)
if %type%==3 (set  filetype=jpg)
if %type%==4 (set  filetype=gif)
if %type%==5 (set  filetype=mp3)
if %type%==6 (set  filetype=wma)
if %type%==7 (set  filetype=htm)
if %type%==8 (echo 请输入文件类型,例如bmp
set /p  filetype=)
if %type%==9 (goto :clear_cache)

:select_del_or_not
echo 提取后是否删除原文件?(y/n)
set /p delornot=
if %delornot%==y (goto startcopy)
if %delornot%==n (goto startcopy)
goto select_del_or_not
:startcopy
echo 正在提取文件,请稍候……
md %filetype%
for /f "delims=" %%i in ('dir "%userprofile%\Local Settings\Temporary Internet Files\*.%filetype%" /s/b') do if not exist "%CD%\%filetype%\%%~nxi" (
copy /y "%%i" "%CD%\%filetype%\") else (
call :copy_same_name_file "%%~i" "%%~ni" "%%~xi")
if %delornot%==y (for /f "delims=" %%i in ('dir "%userprofile%\Local Settings\Temporary Internet Files\*.%filetype%" /s/b') do del /f/q "%%i")
goto :eof

:copy_same_name_file
set file_n=%2
set file_x=%3
set /a file_num+=1
::变量file_num自加1
echo %file_num%
if not exist "%CD%\%filetype%\%file_n%_%file_num%%file_x%" (
    copy %1 "%CD%\%filetype%\%file_n%_%file_num%%file_x%">nul
) else call :copy_same_name_file %1 %2 %3
set file_num=0
goto :eof
:clear_cache
for /f "delims=" %%i in ('dir "%userprofile%\Local Settings\Temporary Internet Files\*.*" /s/b') do del /f/q "%%i"
goto :eof
作者: lzmuhioin     时间: 2007-9-28 20:37
强贴,请问楼主"%%~i"是起什么作用呢,我知道扩充%i,但是具体作用是什么呢?能详细说明一下,麻烦楼主和版主了
作者: xswdong     时间: 2007-10-2 19:06
使用后发现,只建立了相应的文件夹,里面什么都没有.
作者: pooloo     时间: 2007-10-8 17:08
"%%~i"是文件名,不带前面的路径.
"%%~ni" 是文件名,不带路径,后缀
"%%~xi"是后缀
作者: pp99     时间: 2007-10-8 17:31

作者: hdzc     时间: 2007-10-8 19:21
非常好用!
作者: xswdong     时间: 2007-10-8 21:07
昨天不能用今天就好了 好用
作者: kaikai163     时间: 2008-4-24 20:19
楼主好牛啊!!!!正需要解决这个问题!
作者: ktv98     时间: 2008-4-24 23:28
太好了.意想不到.