Closed Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    11-05-2009
    Location
    milwaukee
    MS-Off Ver
    Excel 2003
    Posts
    35

    cleanup script not deleting ie subfolders

    Basically i want the script to cleanup not only the temporary internet cache, but also the subfolders within this folder. it appears to delete them but if you copy/paste the file path they are still there.

    example of subfolders not deleted: (the folder is 1y676dfn)
    -if i got to the file path its empty
    -if i run ccleaner, it then deletes the file since its still there
    -hidden files are visible along with sys files

    C:\DOCUME~1\jroe1\LOCALS~1\Temp\Temporary Internet Files\Content.IE5\1Y676DFN\6[2].jpg 2 KB

    C:\DOCUME~1\jroe1\LOCALS~1\Temp\Temporary Internet Files\Content.IE5\1Y676DFN\6[3].jpg 2 KB

    C:\DOCUME~1\jroe1\LOCALS~1\Temp\Temporary Internet Files\Content.IE5\1Y676DFN\6[4].jpg 3 KB


    *** code **


    @echo off
    title Cleanup utility - must use an admin account - %computername% (ver. 2009-11-19)
    rem ===================================================================
    rem Cleans temp files, temporary, prefetch and java cache
    rem ===================================================================

    rem ===================================================================
    color 17
    set Lokal_sti=Lokale~1
    rem tjek sprog (engelsk?) via pause kommandoen
    echo a | pause | find "any key" >nul
    IF %errorlevel% EQU 0 set Lokal_sti=Locals~1
    echo Type Ctrl-C to stop and exit, press Enter until each phase is completed
    echo This program will clean up each individual's temporary files unlike ATF/Ccleaner
    echo Like ATF, this requires the admin account
    rd c:\windows\TEMP /s /q
    md C:\windows\TEMP
    echo windows temp files cleaned
    pause
    rd c:\windows\Prefetch /s /q
    md C:\windows\Prefetch
    echo windows prefecth folder cleaned
    pause
    for /d %%i in ("c:\documents and settings\*") do call :DelInet "%%i"
    pause
    goto :eof
    :DelInet
    echo Nu slettes data for: %~1
    for /d %%j in ("%~1\%Lokal_sti%\Temporary Internet Files\Content.IE5\*") do call :DelTDir "%%j"
    del "%~1\%Lokal_sti%\Temporary Internet Files\Content.IE5\." /q /a
    echo ie temporary internet files cleaned
    for /d %%j in ("%~1\%Lokal_sti%\Temp\*") do call :DelTdir "%%j"
    del "%~1\%Lokal_sti%\Temp\." /q /a
    echo local user temp files cleaned
    for /d %%j in ("%~1\%Lokal_sti%\Temporary Internet Files\*") do call :DelTDir "%%j"
    del "%~1\%Lokal_sti%\Temporary Internet Files\." /q /a


    for /d %%j in ("%~1\%Lokal_sti%\Temp\Temporary Internet Files\Content.IE5\*") do call :DelTDir "%%j"
    del "%~1\%Lokal_sti%\Temp\Temporary Internet Files\Content.IE5\." /q /a

    for /d %%j in ("%~1\%Lokal_sti%\Temp\Temporary Internet Files\*") do call :DelTDir "%%j"
    del "%~1\%Lokal_sti%\Temp\Temporary Internet Files\." /q /a




    echo clearing Every user's java cache folder
    for /d %%j in ("%~1\Application Data\Sun\Java\Deployment\javaws\cache\*") do call :DelTDir "%%j"
    del "%~1\Application Data\Sun\Java\Deployment\javaws\cache\." /q /a
    for /d %%j in ("%~1\Application Data\Sun\Java\Deployment\cache\*") do call :DelTDir "%%j"
    del "%~1\Application Data\Sun\Java\Deployment\cache\." /q /a
    for /d %%j in ("%~1\Application Data\Sun\Java\Deployment\cache\6.0\*") do call :DelTDir "%%j"
    del "%~1\Application Data\Sun\Java\Deployment\cache\6.0\." /q /a


    echo ===================================================================
    goto :eof
    :DelTDir
    echo Sletter %~1
    del "%~1\." /q /a
    rd "%~1"
    goto :eof

  2. #2
    Forum Moderator teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    2003 & 2010
    Posts
    10,033

    Re: cleanup script not deleting ie subfolders

    Huh? You sure you're in the right forum? This is the Water Cooler in the Excel forum. Your question is about DOS batch processing.
    teylyn
    Microsoft MVP - Excel
    At Excelforum, you can say "Thank you!" by clicking the icon below the post.

    Avoid pie charts with more than two data points. Why? See here (pdf, 559 kb). The only acceptable pie chart is here.

  3. #3
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,207

    Re: cleanup script not deleting ie subfolders

    While this section of the forum is not Excel-specific, it's really not the place to be asking questions of a technical nature for other applications either. Try searching the web for DOS/command line scripting.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0