Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I created this batch file (XP Cleanup.bat) to faster automate deleting temporary files. I currently have the batch file logging the user, start, and end time of when it ran. I would like to have a more detailed log file. For example how many files from each location were deleted and the time to do it. I am not sure that this is even possible. I found that using the command (dir "%userprofile%\cookies" /b/s /a-d |find /v /c "::" >> Cleanup.txt) would give me the number of cookies/files in the “Cookies” folder. When I try to create a variable with the command (dir "%userprofile%\cookies" /b/s /a-d |find /v /c "::" ) it errors. Can anyone help me?
Thank you.
XP Cleanup.bat
@ECHO OFFcd "c:\T1"
echo %userprofile:~26% >> Cleanup.txt
echo Start: %Date% %time% >> Cleanup.txttitle Deleting Cookies. . .
cd "%userprofile%\Cookies"
del *.* /F /S /Q /A: R /A: H /A: A
clstitle Deleting Internet History. . .. . .
cd "%userprofile%\Local Settings\History"
del *.* /F /S /Q /A: R /A: H /A: A
rmdir /s /q "%userprofile%\Local Settings\History\History.IE5"
clstitle Deleting Local Temp Files. . .
cd "%userprofile%\Local Settings\Temp"
del *.* /F /S /Q /A: R /A: H /A: A
rmdir /s /q "%userprofile%\Local Settings\Temp"
clstitle Deleting Local Users Temporary Internet Files. . .
cd "%userprofile%\Local Settings\Temporary Internet Files"
del *.* /F /S /Q /A: R /A: H /A: A
rmdir /s /q "%userprofile%\Local Settings\Temporary Internet Files\Content.IE5"
clstitle Deleting Windows Temp Files. . .
cd "C:\WINDOWS\Temp"
del *.* /F /S /Q /A: R /A: H /A: A
rmdir /s /q "C:\WINDOWS\Temp"
clstitle Emptying Recycling Bin...
rem must copy nircmd.exe to System32 folder to work
nircmd.exe emptybin
clscd "c:\T1"
echo Finish: %Date% %time% >> Cleanup.txt
echo. >> Cleanup.txtEXIT
Cleanup.txt
Default
Start: Wed 05/02/2007 21:50:48.78
Finish: Wed 05/02/2007 21:50:48.88

What's the error?
=====================================
If at first you don't succeed, you're about average.M2

![]() |
Create help file
|
Create batch file prompt
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |