can someone write a batch file for me?

chronic9

Supreme [H]ardness
Joined
Aug 18, 2004
Messages
5,854
When I surf the web or access [H] forums from college, it a pain in the @$$ to delete all the temp files. Sometimes they even disable letting you go IE tools and then to clear temp files. So i am wonder if sum1 can write me a batch file that will clear all cookies and temp files?

I know about Window Washer but, I am not gonna install it everytime i sit down @ 1 of the PCs.

t[H]nx
 
I dont believe batch files are not used in Windows XP. Its easy to do aslong as you OS allows it.
 
Windows XP and Window2000 still allow batch files.

Any text file with an extension of ".bat" can be a batch file.

The trick is knowing where those temp files are located.

A standard approach would be
Code:
del "c:\documents and settings\profileid\local settings\history\*.*"
del "c:\documents and settings\profileid\local settings\temp\*.*"
del "c:\documents and settings\profileid\local settings\temporary internet files\*.*"
del "c:\documents and settings\profileid\local settings\cookies\*.*"
deltree "c:\documents and settings\profileid\local settings\application data\*.*"

NOTE, the profileid is the key. Every user has a unique id, so you need to find out what your unique id is and change the batch code.

For example, if your id is pr0nking :eek:, then one of the lines would be
del "c:\documents and settings\pr0nking\local settings\cookies\*.*"

I would strongly recommend you test those paths with a dir command first. Just popup a Command Prompt window and type in all the commands, one at a time. For example,
Code:
dir "c:\documents and settings\profileid\local settings\history\*.*"

That way you can be sure the paths are correct before doing a complete delete and deltree.

Please remember, you still have all the Most Recently Used files lists in the Registry. That requires editing the registry to clear.
 
To expand on what PBJ said just throw the following into a batch file:

(Create a new file in Notepad and save it as BLAH.bat)

del "%HOMEPATH%\local settings\history\*.*" /S /F /Q
del "%HOMEPATH%\local settings\temp\*.*" /S /F /Q
del "%HOMEPATH%\local settings\temporary internet files\*.*" /S /F /Q
del "%HOMEPATH%\local settings\cookies\*.*" /S /F /Q
 
/Q does a delete in quiet mode
/S deletes the specified files
/F force deletes of read only files
 
pbj75 said:
/Q does a delete in quiet mode
/S deletes the specified files
/F force deletes of read only files

Actually /S tells it to include subdirectories. Its equivalent to the former deltree command. :)
 
stolen directly from my thread...http://www.hardforum.com/showthread.php?t=828023
echo off
echo -E's cleanup XP and Defrag automated - ENGLISH Windows XP
::delete the "::" to make the file effective.
::Insert systemdrive letter here ex c: if this file is not located on the system drive
cd "%USERPROFILE%\Local Settings\Temp"
::del /q /s /f *.*
cd "%USERPROFILE%\Local Settings\Temporary Internet Files"
::del /q /s /f *.*
cd "%SystemRoot%\Temp"
::del /q /s /f *.*
::cleanmgr /sagerun:99
::ex use "defrag c: -f" to force defrag on drives with less than 15% free space
::defrag c:
::defrag d:
::defrag e:
::defrag f:
::defrag g:
::etc you get the idea!
pause
 
korpse is correct. I didn't paste in the entire sentence :eek:

/S deletes the specified files from all subdirectories
 
Back
Top