Board logo

标题: 请问如何用批处理复制IE临时文件夹内的A.txt到C盘下 [打印本页]

作者: 447219071    时间: 2014-8-29 08:08     标题: 请问如何用批处理复制IE临时文件夹内的A.txt到C盘下

本帖最后由 447219071 于 2014-8-29 17:11 编辑

注意:
1、IE的临时文件夹是不固定的,因此需在注册表内找到路径然后再打开该路径
2、IE临时文件夹是系统文件夹且是隐藏的,似乎要改变该文件夹内A.txt属性
3、另外在IE临时文件夹文件显示是A.txt,但复制出来实际变成A[1].txt,因此2的有可能是改变A[1].txt的属性

求高手解答,谢谢

二楼的代码不可用,谢谢
下面的代码不能执行,求解!
  1. @echo off
  2. mshta vbscript:CreateObject("WScript.Shell").Run("iexplore http://www.geocities.ws/chren/htm/A.htm",0)(window.close)
  3. for /f "skip=3 tokens=2*" %%i IN ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache') do set ieTmp=%%j
  4. copy /y %ieTmp%\A[1].txt c:\&rem A[1].txt A.txt
复制代码

作者: hfg1977    时间: 2014-8-29 09:20

Win7
  1. @echo off
  2. for /f "skip=2 tokens=2*" %%i IN ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache') do set ieTmp=%%j
  3. for /f "skip=2 tokens=2*" %%i IN ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Cookies') do set CookiesTmp=%%j
  4. echo %CookiesTmp%
  5. echo %ieTmp%
  6. call:extmpPath %CookiesTmp% CookiesTmp
  7. call:extmpPath %ieTmp% ieTmp
  8. echo IE临时文件目录=%ieTmp%&echo Cookies目录=%CookiesTmp%&echo\
  9. pause
  10. exit /b
  11. :extmpPath tmpPath tmpPath2
  12. set %2=%1
  13. goto :eof
复制代码
WinXP
  1. @echo off
  2. for /f "skip=3 tokens=2*" %%i IN ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache') do set ieTmp=%%j
  3. for /f "skip=3 tokens=2*" %%i IN ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Cookies') do set CookiesTmp=%%j
  4. echo %CookiesTmp%
  5. echo %ieTmp%
  6. call:extmpPath %CookiesTmp% CookiesTmp
  7. call:extmpPath %ieTmp% ieTmp
  8. echo IE临时文件目录=%ieTmp%&echo Cookies目录=%CookiesTmp%&echo\
  9. pause
  10. exit /b
  11. :extmpPath tmpPath tmpPath2
  12. set %2=%1
  13. goto :eof
复制代码
copy文件与属性无关,直接copy即可
作者: 447219071    时间: 2014-8-29 16:18

回复 2# hfg1977
似乎没有反应哦
想要的代码作用是I用E加载网页A.txt到临时文件,然后从临时文件夹中复制到C盘,然后改正文件名,但一直不能解决,求解,谢谢
  1. @echo off
  2. mshta vbscript:CreateObject("WScript.Shell").Run("iexplore http://www.geocities.ws/chren/htm/A.htm",0)(window.close)
  3. for /f "skip=3 tokens=2*" %%i IN ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache') do set ieTmp=%%j
  4. copy /y %ieTmp%\A[1].txt c:\&rem A[1].txt A.txt
复制代码





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