获取缓存中的文件并非一个难题,这里只是将这个问题细化。如果将jpg等图片的后缀名改为其他文件的后缀名,也可以提取其他文件。
不熟悉怎么用xcopy的通配符,只好用FOR。- @echo off&title 查看与复制系统IE缓存中的图片
- ::查看与复制系统IE缓存中的图片
- :start
- cls&echo;&echo;
- echo 1、仅复制图片文件
- echo 2、连目录一起复制
- echo 3、打开缓存目录
- echo 4、清空存储目录JpgTmp
- echo 5、清理系统缓存
- echo;
- set /p input= 输入:&echo;
- if %input%==1 goto _All
- if %input%==2 goto _TREE
- if %input%==3 start "" "%userprofile%\Local Settings\Temporary Internet Files\Content.IE5\"
- if %input%==4 rd /s /q "%~dp0JpgTmp"
- if %input%==5 del /f /q /s /a "%userprofile%\Local Settings\Temporary Internet Files\Content.IE5\"
- echo;&echo; OK!
- ping /n 3 127.1.1>nul
- cls&goto start
- :_TREE
- if not exist "%~dp0JpgTmp" md "%~dp0JpgTmp"
- for /d %%a in ("%userprofile%\Local Settings\Temporary Internet Files\Content.IE5\*") do (
- echo:%%a&cd /d %%a
- if not exist "%~dp0JpgTmp\%%~na" md "%~dp0JpgTmp\%%~na"
- for /r %%i in (*.jpg *.gif) do Xcopy /s /y "%%~i" "%~dp0JpgTmp\%%~na"
- )
- cd /d %~dp0
- cls&dir /b "%~dp0JpgTmp"
- pause&goto start
- :_ALL
- if not exist "%~dp0JpgTmp" md "%~dp0JpgTmp"
- for /f "tokens=* delims=" %%a in ('dir /a /b /s "%userprofile%\Local Settings\Temporary Internet Files\*.jpg" "%userprofile%\Local Settings\Temporary Internet Files\*.gif" "%userprofile%\Local Settings\Temporary Internet Files\*.bmp" "%userprofile%\Local Settings\Temporary Internet Files\*.tif" "%userprofile%\Local Settings\Temporary Internet Files\*.png"') do (
- echo;%%a
- if not exist "JpgTmp\%%~a" (xcopy /y "%%~a" JpgTmp) else (xcopy /y "%%~a" "JpgTmp\R_%random%_%%~nxa")
- )
- pause&goto start
- exit
复制代码
|