Saved Bookmarks
| 1. |
Solve : batch file to delete temp files? |
|
Answer» Hi Frdz, Code: [Select]cd c:\that's not really accurate. you don't change to c drive like that. no need to put "cd". just c: will do. anyway, @OP, don't just say it does not work. try to give error messages if you have them, or describe in more detail what you did not see expected.Simple cookie kill batch cls REM ******************************************* REM **Cookie Kill Program Will not work in NT** REM ******************************************* deltree /y c:\windows\cookies\*.* deltree /y c:\windows\tempor~1\*.* pause cls REM Cookies deleted! ========================================================= This version is a little more thurough, deletes alot of junk cls @ECHO OFF ECHO. *********************************** ECHO. ** Clean Cookies and Temp Files ** ECHO. ** Will not work in NT ** ECHO. ******************************* deltree /y c:\windows\cookies\*.* deltree /y c:\windows\tempor~1\*.* deltree /y c:\progra~1\Netscape\Users\default\Cache\*.jpg deltree /y c:\progra~1\Netscape\Users\default\Cache\*.gif deltree /y c:\progra~1\Netscape\Users\default\Cache\*.htm deltree /y c:\progra~1\Netscape\Users\default\archive\*.htm deltree /y c:\progra~1\Netscape\Users\default\archive\*.gif deltree /y c:\progra~1\Netscape\Users\default\archive\*.jpg deltree /y c:\windows\temp\*.* deltree /y c:\temp\*.* deltree /y c:\windows\Recent\*.* deltree /y c:\recycled\*.* cls EXIT ======================================================== WINNT Version @ECHO OFF ECHO ************************************************** ECHO ** DEL replaces DELTREE, /Q replaces /Y ** ECHO ************************************************** del /Q c:\docume~1\alluse~1\Cookies\*.* REM Change alluse~1 in the above line to your userID del /q c:\winnt\temp\*.* del /q c:\temp\*.* del /q c:\winnt\Recent\*.* del /q c:\*.chk EXIT Add these lines for XP del /q C:\Windows\Temp\Adware\*.* del /q C:\Windows\Temp\History\*.* del /q C:\Windows\Temp\Tempor~1\*.* del /q C:\Windows\Temp\Cookies\*.* ===================================================== More can be found here: http://home.att.net/~gobruen/progs/dos_batch/dos_batch.html Hope this helps -Linux711 Hi, by giving this commands it works @ECHO OFF del /q C:\Windows\Temp\*.* Pause exit Yes it does! I don't have any problem deleting the temp files from Windows\temp What about deleting the sub dirs under your D:\Documents and Settings\$username%\Local Settings\Temp? How do you do that? Any ideas? Quote from: raj_1107 on April 17, 2007, 01:11:42 AM
Through batch del %temp%\*.tmp/s pause Quote What about deleting the sub dirs under your D:\Documents and Settings\$username%\Local Settings\Temp? the del command has a /S option for recursively going into subdirectories.yeah, if you use del PATH /s, it deletes sub directories too. EDIT: Oh SORRY, i somehow thought the quote was the question ... |
|