China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-20 05:05
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » (Solved) How to delete all .htm files in the IE temporary folder? View 4,346 Replies 14
Original Poster Posted 2006-12-02 10:06 ·  中国 福建 泉州 电信
中级用户
★★
Credits 234
Posts 129
Joined 2006-11-28 09:21
19-year member
UID 71989
Gender Male
Status Offline
Using "del *.htm" prompts that the file is not found,
Please give guidance, thank you!!~~

[ Last edited by ka56 on 2006-12-1 at 22:33 ]
Floor 2 Posted 2006-12-02 10:12 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
del "IE临时文件夹\*.htm"
Floor 3 Posted 2006-12-02 10:18 ·  中国 福建 泉州 电信
中级用户
★★
Credits 234
Posts 129
Joined 2006-11-28 09:21
19-year member
UID 71989
Gender Male
Status Offline
Originally posted by vkill at 2006-12-1 21:12:
del "IE临时文件夹\*.htm"

Cannot find d:\IE Temporary Folder\*.htm
Don't know why, in CMD..
Floor 4 Posted 2006-12-02 10:23 ·  中国 江苏 南京 电信
高级用户
★★
Credits 623
Posts 214
Joined 2006-09-22 20:48
19-year member
UID 63387
Status Offline
Your purpose may not be just to delete the htm files in the temporary files, but all.
Here's a batch script to clean up junk files:
@echo off
echo Clearing system junk files, please wait...
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo System junk cleared!
echo. & pause
Save it as a bat and run it.

Among them: del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" is the statement to delete the contents of the IE temporary folder.
Floor 5 Posted 2006-12-02 10:26 ·  中国 福建 泉州 电信
中级用户
★★
Credits 234
Posts 129
Joined 2006-11-28 09:21
19-year member
UID 71989
Gender Male
Status Offline
Just need to delete the files of html document type in the path "d:\IE临时文件夹\Temporary Internet Files\", the path is entered correctly,, it should be a mark error of.htm, I don't know how to do it..
Floor 6 Posted 2006-12-02 10:39 ·  中国 福建 泉州 电信
中级用户
★★
Credits 234
Posts 129
Joined 2006-11-28 09:21
19-year member
UID 71989
Gender Male
Status Offline
Thanks a lot,大虾tianzizhi, it's very useful, thanks!!!
I have backed it up,
I don't want to clear the cookies in the IE temporary folder, it should be more complicated, right?

[ Last edited by ka56 on 2006-12-1 at 10:00 PM ]
Floor 7 Posted 2006-12-02 11:27 ·  中国 江苏 南京 电信
高级用户
★★
Credits 623
Posts 214
Joined 2006-09-22 20:48
19-year member
UID 63387
Status Offline
The cookies in the IE temporary folder are useless, there are not many of them in total, they are garbage. The useful cookies are in the cookie file. If you don't want to delete it, remove this line in the batch file:
del /f /q %userprofile%\cookies\*.*
Floor 8 Posted 2006-12-02 11:32 ·  中国 福建 泉州 电信
中级用户
★★
Credits 234
Posts 129
Joined 2006-11-28 09:21
19-year member
UID 71989
Gender Male
Status Offline
Originally posted by tianzizhi at 2006-12-1 22:27:
The cookies in the IE temporary folder are useless, there are not many of them in total, they are garbage. The useful cookies are in the cookie file.
If you don't want to delete them, remove this line from the batch file,
del /f /q %userprofile%\cookies\*.* ...

Got it, thank you very much for the expert's patience!
Because a program I run generates a large number of HTM files, so I came to consult.. :D
Now it's all deleted, done, haha..

Thanks!!......
Floor 9 Posted 2006-12-02 12:05 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Originally posted by ka56 at 2006-12-2 10:18:

Can't find d:\IE temporary folder\*.htm
Don't know why, in CMD..

Sweat, I just meant that, do you really?
Floor 10 Posted 2006-12-02 12:44 ·  中国 福建 泉州 电信
中级用户
★★
Credits 234
Posts 129
Joined 2006-11-28 09:21
19-year member
UID 71989
Gender Male
Status Offline
Originally posted by vkill at 2006-12-1 23:05:

Oh, I just meant that, but you really did?

: ))
I have changed the path... Now I still don't understand how to delete web files. I'm a beginner... It worked... :D
Floor 11 Posted 2007-02-19 23:43 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
The above code is still a bit imperfect. If the user moves the IE temporary folder to another place, heh, it won't work. Mine can judge automatically:

@ECHO OFF
REM Get IECACHE variable and system environment variable SYSTEMP path
REG EXPORT "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "%TEMP%\IEC.TXT" & CLS
TYPE "%TEMP%\IEC.TXT" >"%TEMP%\IECOK.TXT"
FOR /F "tokens=1-2 DELIMS==" %%a in ('FINDSTR /I "Cache" "%TEMP%\IECOK.TXT"') DO SET IECACHE=%%b
REG EXPORT "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "%TEMP%\TEMP.TXT" & CLS
TYPE "%TEMP%\TEMP.TXT" >"%TEMP%\TEMPOK.TXT"
FOR /F "tokens=1-2 DELIMS==" %%a in ('FINDSTR /I "TEMP" "%TEMP%\TEMPOK.TXT"') DO SET SYSTEMP=%%b

DEL /F/Q/S %IECACHE%\*.HTM & CLS
Floor 12 Posted 2007-02-20 05:02 ·  中国 广东 茂名 电信
中级用户
★★
Credits 261
Posts 123
Joined 2006-06-06 19:23
20-year member
UID 56648
Status Offline
Originally posted by HUNRYBECKY at 2007-2-19 23:43:
The above code is still a bit imperfect. If the user moves the IE temporary folder to another place, heh heh, it won't work. Mine can automatically judge:

@ECHO OFF
REM Get IECACHE variable and ...


May I ask if using the query parameter
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache | find "Cache" >%TEMP%\IECOK.TXT
What should be changed below?
FOR /F "tokens=1-2 DELIMS==" %%a in ('FINDSTR /I "Cache" "%TEMP%\IECOK.TXT"') DO SET IECACHE=%%b

The content of the IECOK.TXT file is as follows:
Cache REG_SZ C:\Documents and Settings\user\Local Settings\Temporary Internet Files

[ Last edited by yangzhiyi on 2007-2-20 at 06:11 AM ]
Floor 13 Posted 2007-12-01 14:58 ·  中国 广东 广州 电信
初级用户
Credits 55
Posts 23
Joined 2006-12-22 04:16
19-year member
UID 74239
Gender Male
From 广东
Status Offline
Originally posted by HUNRYBECKY at 2007-2-19 11:43 PM:
The above code is still a bit imperfect. If the user moves the IE temporary folder to another place, heh heh, it won't work. My this one can automatically judge:

@ECHO OFF
REM Get IECACHE variable and ...

Why does it prompt that the path is not found on my machine?
Floor 14 Posted 2007-12-02 01:55 ·  中国 重庆 九龙坡区 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Originally posted by yangzhiyi at 2007-2-20 05:02 AM:
How to modify if using query parameter
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache | find "Cache" >%TEMP%\IECOK.TXT
What should be changed below?
FOR /F "tokens=1-2 DELIMS==" %%a in ('FINDSTR /I "Cache" "%TEMP%\IECOK.TXT"') DO SET IECACHE=%%b

The content of IECOK.TXT file is as follows:
Cache REG_SZ C:\Documents and Settings\user\Local Settings\Temporary Internet Files

Just use semicolon as the delimiter
FOR /F "tokens=1-2 DELIMS=:" %%a in ('FINDSTR /I "Cache" "%TEMP%\IECOK.TXT"') DO (
set left=%%a
set right=%%b
)
set ietemp=%left:~-1%%right%
Floor 15 Posted 2008-01-23 08:16 ·  中国 浙江 温州 平阳县 电信
初级用户
Credits 97
Posts 42
Joined 2006-10-05 22:12
19-year member
UID 64633
Gender Male
Status Offline
My IE temporary folder is placed on a non-system drive, and I don't want to delete cookies.
Forum Jump: