Skip to content

Instantly share code, notes, and snippets.

@kshwetabh
Last active December 15, 2015 17:29
Show Gist options
  • Save kshwetabh/5296378 to your computer and use it in GitHub Desktop.
Save kshwetabh/5296378 to your computer and use it in GitHub Desktop.
Ant Task to clear the Internet Explorer browser cache. Add this task to your ant build file and it will make sure to clear your browser cache on each build. Might be handy if you need to build your UI code (JS/JSP, etc) to copy to deploy directory after editing the source.
<target name="CleanIECache">
<echo>Clearing browser cache...</echo>
<exec executable="C:\Windows\System32\rundll32.exe">
<arg value="InetCpl.cpl,"/>
<arg value="ClearMyTracksByProcess"/>
<arg value="8"/>
</exec>
</target>
<!--
If you are feeling creative, here are the other flags
(Note: I have not tested all of them but just the Clear Temp Internet Files, and it works :) )
- Clear Temporary Internet Files:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
- Clear Cookies:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
- Clear History:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
- Clear Form Data:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
- Clear Saved Passwords:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32
- Delete All:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
- Delete All w/Clear Add-ons Settings:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment