Keeping the computer clean

9 views
Skip to first unread message

RemyMaza

unread,
Sep 21, 2008, 9:47:01 PM9/21/08
to Computer Tech Support
Just something I've been using lately that I think people here would
benefit from. This is a batch file that I run on many of my pc's
within my network. Save this code in a text file and change the
extension to .bat. I hope you find this useful.


Rem ****************** Code Starts***********************

@echo off
cls
title Clean My PC for XP By Matt Bramer
Rem You are free to use this however you want. Modify the code to
whatever suits your needs.
color 0E

echo Start Time is: %time%

Rem ********* Delete Temporary Internet Files: ****
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8


Rem ********* Delete Cookies: *********************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2


Rem ********* Delete History: *********************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1


Rem ********* Delete Form Data: *******************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16


Rem ********* Delete Passwords: *******************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32


Rem ********* Remove All IE Cached Data ***********
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255


Echo ********* Removing All Temp Files and Cookies for IE
*************
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

Echo.
Echo Removal of All Temp Files and Cookies for IE has Completed!

Echo.
Echo.
Echo.



Echo ********* Removing PC Temporary Files **********
rmdir /S /Q "%userprofile%\Local Settings\Temp" 2>Nul
mkdir "%userprofile%\Local Settings\Temp" 2>Nul


rmdir /S /Q %windir%\Temp 2>Nul
mkdir %windir%\Temp 2>Nul


c:\windows\system32\cleanmgr.exe /dc /sagerun: 1

Echo.
Echo Removal of PC Temporary Files has Completed!

Echo.
Echo.
Echo.



Echo ********* Defragging Hard Drive **************
defrag C: -f -v

GOTO End

:End
Echo Geeks have just cleaned your PC for free... Be thankful!
Echo Finish Time is: %time%

Pause
exit


Rem ****************** Code Ends***********************


Regards,
Matt
www.crossloop.com/matthewbramer

Dentist

unread,
Sep 25, 2008, 8:39:02 AM9/25/08
to Computer Tech Support
'Echo Geeks have just cleaned your PC for free... """"Be thankful"""'

Thank you...helpful

RemyMaza

unread,
Sep 25, 2008, 9:44:29 PM9/25/08
to Computer Tech Support
Here's the Vista version of Clean My PC; remember to save this code in
notepad and change the extension to .bat:


Rem ************************ Code Starts
*******************************

@echo off
cls
title Clean My PC for Vista By Matt Bramer
color 0E

echo Start Time is %time%

Echo.
Echo.

Rem ********* Delete Temporary Internet Files: ****
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8


Rem ********* Delete Cookies: *********************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2


Rem ********* Delete History: *********************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1


Rem ********* Delete Form Data: *******************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16


Rem ********* Delete Passwords: *******************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32


Rem ********* Remove All IE Cached Data ***********
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255


Echo ********* Removing All Temp Files and Cookies for IE
*************
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

Echo.
Echo Removal of Temp Files are Complete!

Echo.
Echo.
Echo.


Echo ********* Removing PC Temporary Files **********
rmdir /S /Q %userprofile%\AppData\Local\Temp 2>Nul
mkdir %userprofile%\AppData\Local\Temp 2>Nul


rmdir /S /Q %windir%\Temp 2>Nul
mkdir %windir%\Temp 2>Nul


c:\windows\system32\cleanmgr.exe /dc /sagerun: 1

Echo.
Echo Removal of PC Temporary Files Complete!

Echo.
Echo.
Echo.



Echo ********* Vista Defrag All Drives **************
defrag C: -w -f -v

GOTO End

:End
Echo Geeks have just cleaned your PC for free... Be thankful!
Echo Finish Time is: %time%

Pause
exit

Rem ****************** Code Ends***********************



Regards,
Matt
www.crossloop.com/matthewbramer

> > Mattwww.crossloop.com/matthewbramer- Hide quoted text -
>
> - Show quoted text -

BigMatt

unread,
Oct 2, 2008, 8:46:28 PM10/2/08
to Computer Tech Support
Remember folks, when changing this to .bat

You need to change the option of 'Text files only' to 'All File Types'
> > > Mattwww.crossloop.com/matthewbramer-Hide quoted text -

shadi_82jo

unread,
Oct 4, 2008, 7:25:02 PM10/4/08
to Computer Tech Support
how can i change the option of text files to all files to rename
it .bat
> > > > Mattwww.crossloop.com/matthewbramer-Hidequoted text -
>
> > > - Show quoted text -- Hide quoted text -

RemyMaza

unread,
Oct 5, 2008, 3:49:21 PM10/5/08
to Computer Tech Support
Click file, select Save As. From that dialog box, change the: Save as
type option to "All files". This will allow you to change the name of
the file to whatever you want with the correct extension. So when you
type in the name of the file, make sure you include .bat It should
look like:

filename.bat

Then click save. If you are still having trouble with this, check out
these links:

http://www.google.com/search?hl=en&q=how+to+change+the+extension+of+a+file&aq=f&oq=

Cheers,
Matt
www.crossloop.com/matthewbramer
> > > > > Mattwww.crossloop.com/matthewbramer-Hidequotedtext -

RemyMaza

unread,
Oct 26, 2008, 10:05:30 PM10/26/08
to Computer Tech Support
Here is updated code that deletes just a few more things and uses
system variables instead of hard-coded paths. ;-)
Feel free to use this just don't try to sell it b/c I didn't sell it
to you...

******************************
This is used for XP ONLY!
******************************

REM ********* UPDATED CODE ******************


@echo off
cls

title Windows XP Maintenance Menu by Matt Bramer COLOR 0E

echo Start Time is %time%

echo.
echo.

Rem ********* Delete Temporary Internet Files: ****
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8


Rem ********* Delete Cookies: *********************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2


Rem ********* Delete History: *********************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1


Rem ********* Delete Form Data: *******************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16


Rem ********* Delete Passwords: *******************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

Rem ********* Remove All IE Cached Data ***********
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255

Echo ********* Removing All Temp Files and Cookies for IE*************
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

Echo.
Echo Removal of All Temp Files and Cookies for IE has Completed!

Echo.
Echo.
Echo.



Echo ********* Removing PC Temporary Files ***********************
rmdir /S /Q "%userprofile%\Local Settings\Temp" 2>Nul
mkdir "%userprofile%\Local Settings\Temp" 2>Nul

del /s /q "%userprofile%\Cookies" 2>Nul

rmdir /S /Q %windir%\Temp 2>Nul
mkdir %windir%\Temp 2>Nul


c:\windows\system32\cleanmgr.exe /dc /sagerun: 1

Echo.
Echo Removal of PC Temporary Files has Completed!

Echo.
Echo.
Echo.



Echo ********* Defragging Hard Drive ***************************
defrag %systemdrive% -f -v

echo.
echo.
echo.

GOTO End

Echo.
Echo.
Echo.

:End
Echo Geeks have just cleaned your PC for free... Be thankful!
Echo Finish Time is: %time%

Pause
exit

REM ************** CODE ENDS ***********************




*********************************
This is used for Vista ONLY!
*********************************

REM ************* CODE BEGINS *********************
del /s /q "%appdata%\Microsoft\Windows\Cookies" 2>Nul

rmdir /S /Q %windir%\Temp 2>Nul
mkdir %windir%\Temp 2>Nul


c:\windows\system32\cleanmgr.exe /dc /sagerun: 1

Echo.
Echo Removal of PC Temporary Files Complete!

Echo.
Echo.
Echo.

Echo ********* Vista Defrag All Drives **************
defrag %systemdrive% -w -f -v

GOTO End

:End

Echo.
Echo.

Echo Geeks have just cleaned your PC for free... Be thankful!
Echo Finish Time is: %time%

Pause
exit

REM ************ CODE ENDS ******************

You can control what you delete by adding REM in front of any line of
code. When adding REM in front, that line of code doesn't run. I
hope this helps.

Regards,
Matt
www.crossloop.com/matthewbramer
Reply all
Reply to author
Forward
0 new messages