中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-11 10:50
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » How to delete IE temporary files with VBS
Printable Version  1,417 / 6
Floor1 5872169 Posted 2009-02-19 09:54
高级用户 Posts 474 Credits 959
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 ]
Floor2 zhengqian529 Posted 2009-02-19 17:31
初级用户 Posts 93 Credits 100 From 湖南
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.
Floor3 5872169 Posted 2009-02-19 18:11
高级用户 Posts 474 Credits 959
Thank you, friend upstairs. I know the method you mentioned, but I can't delete the index.dat file.
Floor4 jy02116916 Posted 2009-02-20 12:41
初级用户 Posts 37 Credits 68
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)
Floor5 5872169 Posted 2009-02-20 17:46
高级用户 Posts 474 Credits 959
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!
Floor6 HAT Posted 2009-02-20 17:58
版主 Posts 5,017 Credits 9,023
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.
Floor7 slore Posted 2009-02-20 19:54
铂金会员 Posts 2,478 Credits 5,212
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023