none
Delete Internet Temp Files on shutdown

    Question

  • Is there a setting for deleting the internet temp files when a user logs off or shuts down?  I realize there is one to empty temp files on close if IE, but that will nto work for us.

    Thanks,
    Bob
    Tuesday, June 10, 2008 6:04 PM

Answers

  •  

    Hello,

     

    From the description, you have to empty the Temporary internet files folder to solve the word macro error when saving documents. However, you can't count on the "emptying Temporary internet files on IE close" group policy setting because you will be unable to save the files in the mail. You need a practice of cleaning Temporary internet files folder (not cookies) on shutdown.

     

    You may use this script to delete the Temporary internet files as the computer shutdown script for clients. I test it on Windows XP SP2 and it works well. However, I can't guarantee it will work in your environment. Please make sure to test it before implement.

     

    ----------------------------------------------------------------------------

    Const WindowsFolder = 0

    Const SystemFolder = 1

    Const TemporaryFolder = 2

    Dim strProfile

    Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")

    Dim WshNetwork : Set WshNetwork = CreateObject("Wscript.Network")

     

    Dim WshShell

    set WshShell = createobject("wscript.shell")

     

    strProfile = "c:\Documents and Settings\"

     

     

    strWinFolder = fso.GetSpecialFolder(WindowsFolder)

    wscript.echo "Windows folder:" &strWinFolder

    strTempFolder = fso.GetSpecialFolder(TemporaryFolder)

    wscript.echo "TemporaryFolder:" &strTempFolder

     

     

    wscript.echo strprofile & WshNetwork.Username & "\local settings\Temporary internet files\*.* /q"

     

    wshShell.run "cmd /c del " & strprofile & WshNetwork.Username & "\local settings\Temporary internet files\*.* /q", 1, True

     

     

    If fso.FolderExists(strProfile & WshNetwork.username & "\Local Settings\Temporary Internet Files\") Then

    fso.DeleteFile (strProfile & WshNetwork.username & "\Local Settings\Temporary Internet Files\*.*"), True

    fso.DeleteFile (strProfile & WshNetwork.username & "\Local Settings\Temporary Internet Files\Content.IE5\*.*"), True

    End If

    ----------------------------------------------------------------------------

    Note: This script will get a Permission denied error when the Explorer.exe is running.

     

    Hope it helps.

     

    --------------------------------------------------------

    Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose.

     

    This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they cannot modify these examples to provide added functionality or construct procedures to meet specific needs.

     

    If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

     

    http://www.microsoft.com/partner/referral/

    • Edited by Miles LiModerator Wednesday, June 18, 2008 10:15 AM spelling
    • Marked as answer by Osm3um Wednesday, June 18, 2008 9:17 PM
    Wednesday, June 18, 2008 10:14 AM
    Moderator

All replies

  • By shutting down or logging off.....does that not close IE (and with the GPO, not resolve your issue) ?  Can you explain why the GPO for emptying TIF on IE close would not work for you guys?
    You could run a logoff/shutdown script that clears the TIF location


    -Stuart Hudman
    Tuesday, June 10, 2008 11:45 PM
  • You asked, so here goes.

    It's really quite interesting.  As we use sharepoint to save documents form Word XP, there is a little known bug that happens if the TIFs get out of wack if a document is open.  This can happen of the TIF exceeds the limits as defined in IE and if the TIFs are emptied with a document open that has been opened via Sharepoint (webdav).

    The problem with emptying TIFs on IE close is that if a user closes IE with a doc open it can make it so the document can not be saved.  The only solution at that point is to send the doc via email, open it and start again.

    Trust me, I spent about 15 months working with PSS (we were working on a case study with them so they were willing to drag it for as long as necessary) on this one... it is real....

    So, there is an additional bug which comes up, form time to time, when a user saves a document which causes a "macro error" in word.  I have been unable to pin down the exact cause but I do know that emptying the Temp Internet Files fixes it.

    Thus my interest in emptying Temp Internet Files when closing windows.

    As I recall, running a script does not work because the underlying directory structure, not to mention I do not want to delete cookies.

    Thanks for your reply,
    Bob
    Wednesday, June 11, 2008 12:32 AM
  •  

    Hello,

     

    From the description, you have to empty the Temporary internet files folder to solve the word macro error when saving documents. However, you can't count on the "emptying Temporary internet files on IE close" group policy setting because you will be unable to save the files in the mail. You need a practice of cleaning Temporary internet files folder (not cookies) on shutdown.

     

    You may use this script to delete the Temporary internet files as the computer shutdown script for clients. I test it on Windows XP SP2 and it works well. However, I can't guarantee it will work in your environment. Please make sure to test it before implement.

     

    ----------------------------------------------------------------------------

    Const WindowsFolder = 0

    Const SystemFolder = 1

    Const TemporaryFolder = 2

    Dim strProfile

    Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")

    Dim WshNetwork : Set WshNetwork = CreateObject("Wscript.Network")

     

    Dim WshShell

    set WshShell = createobject("wscript.shell")

     

    strProfile = "c:\Documents and Settings\"

     

     

    strWinFolder = fso.GetSpecialFolder(WindowsFolder)

    wscript.echo "Windows folder:" &strWinFolder

    strTempFolder = fso.GetSpecialFolder(TemporaryFolder)

    wscript.echo "TemporaryFolder:" &strTempFolder

     

     

    wscript.echo strprofile & WshNetwork.Username & "\local settings\Temporary internet files\*.* /q"

     

    wshShell.run "cmd /c del " & strprofile & WshNetwork.Username & "\local settings\Temporary internet files\*.* /q", 1, True

     

     

    If fso.FolderExists(strProfile & WshNetwork.username & "\Local Settings\Temporary Internet Files\") Then

    fso.DeleteFile (strProfile & WshNetwork.username & "\Local Settings\Temporary Internet Files\*.*"), True

    fso.DeleteFile (strProfile & WshNetwork.username & "\Local Settings\Temporary Internet Files\Content.IE5\*.*"), True

    End If

    ----------------------------------------------------------------------------

    Note: This script will get a Permission denied error when the Explorer.exe is running.

     

    Hope it helps.

     

    --------------------------------------------------------

    Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose.

     

    This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they cannot modify these examples to provide added functionality or construct procedures to meet specific needs.

     

    If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

     

    http://www.microsoft.com/partner/referral/

    • Edited by Miles LiModerator Wednesday, June 18, 2008 10:15 AM spelling
    • Marked as answer by Osm3um Wednesday, June 18, 2008 9:17 PM
    Wednesday, June 18, 2008 10:14 AM
    Moderator
  • Wonderful!

    I will give that try and thank you for your time,
    Bob
    Wednesday, June 18, 2008 9:17 PM