Help - Search - Members - Calendar
Full Version: Making A Custom-cleaning Program
Darkside_RG > Technical Discussions > Guides/How To > General
wheels2285
Making a Custom-Cleaning Program

***WARNING***

Use at your own discression.
Use ONLY with Windows XP
This is a very powerful program and if used incorrectly can remove files you may need and in worst case senario's can delete your whole hard drive if you add anything to it.
Please follow the steps exactly.


I have created this program about 2 years ago. It still works beautifully and I use it daily.

It can be used with windows 95/98 and ME but you will have to edit the whole file and know what you are doing. I don't suggest you mess with it if you don't know what you are doing.

Lets get started.

Open up NOTEPAD and paste this into it.

CODE
@ECHO OFF
ECHO My Custom Clean-up
PAUSE
ECHO Now Cleaning Cookies...
DEL C:\Docume~1\Matt\Cookies\*.* /q
ECHO Now Cleaning Recent Documents...
DEL C:\Docume~1\Matt\Recent\*.* /q
RMDIR C:\Docume~1\Matt\Recent\ /q /s
ECHO Now Cleaning Temp...
DEL C:\Docume~1\Matt\LocalS~1\Temp\*.* /q
RMDIR C:\Docume~1\Matt\LocalS~1\Temp\ /q /s
MKDIR C:\Docume~1\Matt\LocalS~1\Temp
ECHO Now Cleaning History...
RMDIR C:\Docume~1\Matt\LocalS~1\History\ /q /s
MKDIR C:\Docume~1\Matt\LocalS~1\History\
Echo Now Cleaning Temporary Internet Files...
DEL C:\Docume~1\Matt\LocalS~1\Tempor~1\*.* /q
RMDIR C:\Docume~1\Matt\LocalS~1\Tempor~1\ /q /s
ECHO Now Cleaning Windows Prefetch...
DEL C:\WINDOWS\Prefetch\*.* /q
ECHO Now Cleaning Windows Temp...
RMDIR C:\WINDOWS\Temp\ /q /s
MKDIR C:\WINDOWS\Temp
ECHO Custom Clean-up Finished
PAUSE


Now. What you need to edit on this is where it says Matt everywhere.
what you change it to depends on your computer. To find out what you change it to, you need to open up your C:\ drive and navigate to this destination.

C:\Documents and Settings

There you will see a few folders. 1 will be All Users and one will be Default User
*Note* if you don't see default user, it's because you have hide hidden files and folders turned on so don't worry about it. what you are looking for is the account on the computer in which you use daily. It can be called Owner, or something you named it when you installed XP. Mine is called Wheels.

So I would rename every line in the above code that has Matt in it to Wheels like so.

CODE
@ECHO OFF
ECHO My Custom Clean-up
PAUSE
ECHO Now Cleaning Cookies...
DEL C:\Docume~1\Wheels\Cookies\*.* /q
ECHO Now Cleaning Recent Documents...
DEL C:\Docume~1\Wheels\Recent\*.* /q
RMDIR C:\Docume~1\Wheels\Recent\ /q /s
ECHO Now Cleaning Temp...
DEL C:\Docume~1\Wheels\LocalS~1\Temp\*.* /q
RMDIR C:\Docume~1\Wheels\LocalS~1\Temp\ /q /s
MKDIR C:\Docume~1\Wheels\LocalS~1\Temp
ECHO Now Cleaning History...
RMDIR C:\Docume~1\Wheels\LocalS~1\History\ /q /s
MKDIR C:\Docume~1\Wheels\LocalS~1\History\
Echo Now Cleaning Temporary Internet Files...
DEL C:\Docume~1\Wheels\LocalS~1\Tempor~1\*.* /q
RMDIR C:\Docume~1\Wheels\LocalS~1\Tempor~1\ /q /s
ECHO Now Cleaning Windows Prefetch...
DEL C:\WINDOWS\Prefetch\*.* /q
ECHO Now Cleaning Windows Temp...
RMDIR C:\WINDOWS\Temp\ /q /s
MKDIR C:\WINDOWS\Temp
ECHO Custom Clean-up Finished
PAUSE


Now save your file as clean-up.bat and change the type to all types and save it to desktop.

Double Click the file to run it.

It'll say hit any key to continue. Hit enter or space or something

It'll run through all the files and delete all the useless files on your computer and then will say press any key to continue

Hit enter and the program will close.

*Note*
When the program runs it will sometimes say it could not remove files because they are in use by another program. Don't worry about it. it's normal.

Run this program once a day or once a week, depending on how much you use your computer.

Wheels2285
Zeb
Anyone not used to MS-DOS - be careful when using DEL or ERASE - these commands delete the file and the recycle bin doesn't get a see-in!

Error messages can be removed (creating a tidy script) by redirecting the output.
CODE
del *.tmp >nil
TSKILL
this is a amazing guide, thanks!
transient
One thing I would change is the prefetch. Deleting this is actually not a good idea since it helps in loading apps you use regularly and Windows will clean out the older files after it reaches a certain size anyway.


For those interested, just delete this part:

ECHO Now Cleaning Windows Prefetch...
DEL C:\WINDOWS\Prefetch\*.* /q
syn-ack
Thanks for your work wheels2285 clapping.gif

Much appreciated drinks.gif
Braggy
Brilliant post nice one, will test it out on my other computer! :) Thanks!
videodan
Thanks, that was a great application. I will use this on a regular basis. clapping.gif
YorickH
thnx for the post and the hard work, but 1 question, isnt this what all the "tune up" "i clean your pc so it runs UBER fast xD" software does?
Harb
not exactly sure but this is simply clearing out temporary files - and the prefetch which is something you SHOULD NOT mess with. Saves some space on your hard disk. The clean up progs prolly edit registry settings and system files to try and get best results but i dont think its a good idea most of the time fool.gif

BTW thanks for the code, havnt used dos in a while forgot its purposes!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.