22 replies
by detroitreds Accepted solution
by unhappyuser Accepted solution
Go to this link and scroll down to the Accepted Solution. It's VERY long! Good luck!
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/2000/Q_20794666.html
EMD
by detroitreds Accepted solution
by unhappyuser Accepted solution
You don't need one. If you scroll down far enough the solution is visible.
EMD
by wizard-09 Accepted solution
@echo off
del /Q /F "%USERPROFILE%\Cookies\*.txt"
del /Q /F "%USERPROFILE%\LocalSettings\Temp\*.*
goto
:end
Edited for mistake made on temp file del
tested now works
Keep us informed as to your progress if you require further assistance.
If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as Helpful so that others may benefit from the outcome.
by unhappyuser Accepted solution
This appears to only delete files in one profile. How does it delete the files in many, which I think is what they asked for?
EMD
by wizard-09 Accepted solution
by snuffy09 Accepted solution
by detroitreds Accepted solution
by wizard-09 Accepted solution
by snuffy09 Accepted solution
options>include>add folder
if you have the drive mapped you can select the folder you want to clean out
by detroitreds Accepted solution
by unhappyuser Accepted solution
I assumed he wanted to remove the files from all profiles in one quick script. Thanks.
EMD
by wizard-09 Accepted solution
by wizard-09 Accepted solution
echo off
cd /d "%AllUsersProfile%\.."
set Docs=%CD%
for /d %%a in (*.*) do call :Del %%a
goto :eof
:Del
echo Cleaning up user "%*"
echo rd /s /q "%Docs%\%*\Cookies"
echo md /s /q "%Docs%\%*\Cookies"
echo rd /s /q "%Docs%\%*\Local Settings\Temporary Internet Files"
echo md /s /q "%Docs%\%*\Local Settings\Temporary Internet Files"
echo rd /s /q "%Docs%\%*\Local Settings\Temp"
echo md /s /q "%Docs%\%*\Local Settings\Temp"
I think this is the one your looking for :P
by detroitreds Accepted solution
by unhappyuser Accepted solution
OK try
Delete Cookies\Temp Internet, using VB (don’t panic its easy!)
source: http://support.microsoft.com/default.aspx?scid=KB;en-us;q262110
Paste the text below (not the ****) into notepad and save as "delete.vbs"
Then simply run the file
****************************************************************************************************88
Option Explicit
Private Declare Function FindFirstUrlCacheGroup Lib "wininet.dll" ( _
ByVal dwFlags As Long, _
ByVal dwFilter As Long, _
ByRef lpSearchCondition As Long, _
ByVal dwSearchCondition As Long, _
ByRef lpGroupId As Date, _
ByRef lpReserved As Long) As Long
Private Declare Function FindNextUrlCacheGroup Lib "wininet.dll" ( _
ByVal hFind As Long, _
ByRef lpGroupId As Date, _
ByRef lpReserved As Long) As Long
Private Declare Function DeleteUrlCacheGroup Lib "wininet.dll" ( _
ByVal sGroupID As Date, _
ByVal dwFlags As Long, _
ByRef lpReserved As Long) As Long
Private Declare Function FindFirstUrlCacheEntry Lib "wininet.dll" Alias "FindFirstUrlCacheEntryA" ( _
ByVal lpszUrlSearchPattern As String, _
ByRef lpFirstCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, _
ByRef lpdwFirstCacheEntryInfoBufferSize As Long) As Long
Private Type INTERNET_CACHE_ENTRY_INFO
dwStructSize As Long
szRestOfData(1024) As Long
End Type
Private Declare Function DeleteUrlCacheEntry Lib "wininet.dll" Alias "DeleteUrlCacheEntryA" ( _
ByVal lpszUrlName As Long) As Long
Private Declare Function FindNextUrlCacheEntry Lib "wininet.dll" Alias "FindNextUrlCacheEntryA" ( _
ByVal hEnumHandle As Long, _
ByRef lpNextCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, _
ByRef lpdwNextCacheEntryInfoBufferSize As Long) As Long
Private Const CACHGROUP_SEARCH_ALL = &H0
Private Const ERROR_NO_MORE_FILES = 18
Private Const ERROR_NO_MORE_ITEMS = 259
Private Const CACHEGROUP_FLAG_FLUSHURL_ONDELETE = &H2
Private Const BUFFERSIZE = 2048
Private Sub Command1_Click()
Dim sGroupID As Date
Dim hGroup As Long
Dim hFile As Long
Dim sEntryInfo As INTERNET_CACHE_ENTRY_INFO
Dim iSize As Long
On Error Resume Next
' Delete the groups
hGroup = FindFirstUrlCacheGroup(0, 0, 0, 0, sGroupID, 0)
' To avoid error using it with IE4 as FindFirstUrlCacheGroup is not implemented
If Err.Number <> 453 Then
If (hGroup = 0) And (Err.LastDllError <> 2) Then
MsgBox "An error occurred enumerating the cache groups" & Err.LastDllError
Exit Sub
End If
Else
Err.Clear
End If
If (hGroup <> 0) Then
'we succeeded in finding the first cache group.. enumerate and
'delete
Do
If (0 = DeleteUrlCacheGroup(sGroupID, CACHEGROUP_FLAG_FLUSHURL_ONDELETE, 0)) Then
' To avoid error using it with IE4 as FindFirstUrlCacheGroup is not implemented
If Err.Number <> 453 Then
MsgBox "Error deleting cache group " & Err.LastDllError
Exit Sub
Else
Err.Clear
End If
End If
iSize = BUFFERSIZE
If (0 = FindNextUrlCacheGroup(hGroup, sGroupID, iSize)) And (Err.LastDllError <> 2) Then
MsgBox "Error finding next url cache group! - " & Err.LastDllError
End If
Loop Until Err.LastDllError = 2
End If
' Delete the files
sEntryInfo.dwStructSize = 80
iSize = BUFFERSIZE
hFile = FindFirstUrlCacheEntry(0, sEntryInfo, iSize)
If (hFile = 0) Then
If (Err.LastDllError = ERROR_NO_MORE_ITEMS) Then
GoTo done
End If
MsgBox "ERROR: FindFirstUrlCacheEntry - " & Err.LastDllError
Exit Sub
End If
Do
If (0 = DeleteUrlCacheEntry(sEntryInfo.szRestOfData(0))) _
And (Err.LastDllError <> 2) Then
Err.Clear
End If
iSize = BUFFERSIZE
If (0 = FindNextUrlCacheEntry(hFile, sEntryInfo, iSize)) And (Err.LastDllError <> ERROR_NO_MORE_ITEMS) Then
MsgBox "Error: Unable to find the next cache entry - " & Err.LastDllError
Exit Sub
End If
Loop Until Err.LastDllError = ERROR_NO_MORE_ITEMS
done:
MsgBox "cache cleared"
Command1.Enabled = True
End Sub
*************************************************************************************
by ---tk--- Accepted solution
by detroitreds Accepted solution
I appreciate your help, but it again cleans the files on the local C: drive. I have a batch file that does that already.
For example, let's say I manually map a drive or do net use z: \\computer name\c$, I'm looking at cleaning within that Z drive.
by bizzo Accepted solution
Change the value of profile root to whatever location the user profiles are in.
Also, remove the echos, just there for testing.
But please make sure it deletes only what you want deleting BEFORE removing the echos!
------------------------------------
@echo off
Set profileroot=d:\documents and settings
FOR /F "tokens=*" %%I IN ('DIR /B /AD "%profileroot%"') DO (
echo del /s /q "%profileroot%\%%I\Cookies\*"
echo del /s /q "%profileroot%\%%I\Local Settings\Temporary Internet Files\*"
echo del /s /q "%profileroot%\%%I\Local Settings\Temp\*"
)
------------------------------------
by detroitreds Accepted solution
by detroitreds Accepted solution
I actually like your idea to delete and create the folder. This would obviously make it faster. Would you be able to implement it with the following. This deletes each file seperatly. I would appreciate it if you could incorporate yours with this one:
D:\documents and settings is where I would put in the mappped drive folder I want the batch file to point to.
------------------------------------
@echo off
Set profileroot=d:\documents and settings
FOR /F "tokens=*" %%I IN ('DIR /B /AD "%profileroot%"') DO (
echo del /s /q "%profileroot%\%%I\Cookies\*"
echo del /s /q "%profileroot%\%%I\Local Settings\Temporary Internet Files\*"
echo del /s /q "%profileroot%\%%I\Local Settings\Temp\*"
)
------------------------------------
This discussion is closed to new replies.
Trending Hardware posts
Sort by Trending