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-08-11 09:47
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to delete IE temporary files with VBS View 1,415 Replies 6
Original Poster Posted 2009-02-19 09:54 ·  中国 山东 联通
高级用户
★★★
Credits 959
Posts 474
Joined 2007-10-25 10:40
18-year member
UID 100716
Gender Male
Status Offline
How to delete IE temporary files with VBS?

If using BAT, some IE temporary files cannot be deleted. If using VBS to simulate keyboard operations, sometimes the focus cannot be found. Please help me modify the code, thank you?

WScript.Sleep 1600
WshShell.AppActivate "Internet Properties"
WScript.Sleep 600
WshShell.AppActivate "Internet Properties"
WshShell.SendKeys "%D"
WScript.Sleep 600
WshShell.AppActivate "Internet Properties"
WshShell.SendKeys "%A"
WScript.Sleep 600
WshShell.AppActivate "Internet Properties"
WshShell.SendKeys "%D"
WScript.Sleep 600
WshShell.AppActivate "Internet Properties"
WshShell.SendKeys "%Y"
WScript.Sleep 1000
WshShell.AppActivate "Internet Properties"
WshShell.SendKeys "{esc 2}"

[ Last edited by 5872169 on 2009-2-20 at 18:31 ]
Floor 2 Posted 2009-02-19 17:31 ·  美国 华盛顿州 金 雷德蒙德 Microsoft
初级用户
★★
Credits 100
Posts 93
Joined 2009-01-14 15:04
17-year member
UID 136661
Gender Male
From 湖南
Status Offline
Actually, the temporary files of your IE are stored in the computer at: C:\Documents and Settings\v-fesong\Local Settings\Temporary Internet Files. (v-fesong is the account name.) Using commands is much more convenient than using the sendkeys() method for you.
Floor 3 Posted 2009-02-19 18:11 ·  中国 山东 济南 联通
高级用户
★★★
Credits 959
Posts 474
Joined 2007-10-25 10:40
18-year member
UID 100716
Gender Male
Status Offline
Thank you, friend upstairs. I know the method you mentioned, but I can't delete the index.dat file.
Floor 4 Posted 2009-02-20 12:41 ·  中国 北京 鹏博士BGP
初级用户
Credits 68
Posts 37
Joined 2008-08-15 11:07
17-year member
UID 123237
Gender Male
Status Offline
If it is IE7, you can directly use rundll32 to call InetCpl.cpl for cleaning. Specific commands:

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
(Delete temporary internet files)
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
(Delete browsing history)
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
(Delete Cookies)
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
(Delete historical form data)
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32
(Delete passwords)
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
(Delete all of the above)
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351
(Delete all of the above, as well as the files and settings saved by IE7 add-ons)
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
5872169 +8 2009-02-20 18:32
Floor 5 Posted 2009-02-20 17:46 ·  中国 山东 济南 联通
高级用户
★★★
Credits 959
Posts 474
Joined 2007-10-25 10:40
18-year member
UID 100716
Gender Male
Status Offline
Thanks to friend jy02116916 upstairs for solving it. I used the RD and DEL commands before, but some files couldn't be deleted, so I used the clumsy method of simulating the keyboard with VBS. Sometimes I couldn't find the focus. Thanks again!
Floor 6 Posted 2009-02-20 17:58 ·  美国 惠普HP
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
It is suggested to lurk more. A post from two years ago: RunDll32 deletes IE7's cookies, history, etc.
http://www.cn-dos.net/forum/viewthread.php?tid=28352

If someone helps you solve the problem, it is suggested to perform the following operations:

1. Modify the post title and add at the beginning of the title.

2. Give points to the correct answerer (your own points will not decrease) to show gratitude. Although everyone comes to the forum to learn rather than for points, giving points to express gratitude can always make those who have spent time and energy helping you selflessly feel a little comforted.

3. If you write the code by yourself with the help of others, post your method to share with everyone. Maybe others can point out the shortcomings in the code and tell you how to improve the execution efficiency, etc. Only through communication can we progress faster.
Floor 7 Posted 2009-02-20 19:54 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
Forum Jump: