PhpDig.net

Go Back   PhpDig.net > General Forums > Coding & Tutorials

Reply
 
Thread Tools
Old 12-05-2003, 04:29 PM   #1
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Clean a PC with autoexec.bat

Title: How to clean up your PC hard drive by editing the autoexec.bat file.

Fact: The majority of people use a PC. Fact: The majority of people use Internet Explorer. Fact: Even if you delete cookies, information about your web surfing habits may be contained in index.dat files on your computer. The below instructions will remove such information from index.dat files, as well as remove other miscellaneous garbage including cookies, while leaving all programs fully functional.

Why pay for a cleanup program when you can do it yourself and know what's being implemented?

Note: These instructions were tested and successfully implemented on a Win98 operating system with C: as the hard drive label. You should read these instructions in full before attempting any changes. You may need to edit accordingly to fit your operating system and hard drive label. These instructions are on an "AS IS" basis. Use at your own risk. No support is offered. Read the below disclaimer.
  1. Make sure you know what you are doing and don't make any typos!!!
  2. Determine and write down the amount of used space on your hard drive. To do this, click Start, Programs, Windows Explorer. Click Files, Properties, and write down the amount of used space on your hard drive.
  3. Locate and write down the full directory path to any cookies, history, temporary, and index.dat files or folders. To find such files or folders, click Start, Find, Files or Folders, search for the appropriate items on your hard drive, mouse over any entries under the In Folder column, and write down the full path.
  4. Make sure you have at least one current startup disk!!! To make a startup disk, click Start, Settings, Control Panel. Double click Add/Remove Programs, click the Startup Disk tab, and follow the instructions. Why not make another startup disk to have as a backup startup disk? Just get another floppy disk and repeat this step.
  5. Make sure to create at least one backup copy of your current autoexec.bat file!!! To make a backup copy, click Start, Programs, MS-DOS Prompt. An MS-DOS window opens and the directory that appears is likely C:\WINDOWS so type cd.. and hit return to get to the C:\ directory. At the C:\> prompt type copy autoexec.bat autoexec.backupcopy on the same line and hit return. Why not make two backup copies? To do so, type copy autoexec.bat autoexec.anotherbackupcopy on the same line at the C:\> prompt and hit return.
  6. From the C:\> prompt in the MS-DOS window, type edit autoexec.bat on the same line and hit return to edit the autoexec.bat file. Add the below lines of code to the end of the file, making sure not to change anything else in the file, but FIRST NOTE that your directory paths may not be the same as the ones listed below, so make changes accordingly. Also, when adding the below lines to your autoexec.bat file, you will need to truncate file or directory names from step three that are over 8 characters long (e.g.: biglongname to biglon~1 and biglongnameagain to biglon~2). Further, any * that you see in the below lines is a place holder (e.g.: *.* means all name.type files and foo*.tmp means all files that start with foo and end with .tmp). One final note: Upon computer startup, the below code will delete the listed files, and Win98 will recreate desktop.ini and clean index.dat files, but other files will be permanently deleted. You can use all or some of the below lines of code, edit as you see fit, but you should keep the first line regardless, as this line speeds up the execution.


    if exist c:\windows\smartdrv.exe c:\windows\smartdrv.exe 2048 16
    DELTREE /y c:\windows\history\*.* > NUL
    DELTREE /y c:\windows\tempor~1\Content.IE5\*.* > NUL
    DELTREE /y c:\windows\temp\cookies\*.* > NUL
    DELTREE /y c:\windows\temp\tempor~1\Content.IE5\*.* > NUL
    DELTREE /y c:\windows\temp\history\History.IE5\*.* > NUL
    DELTREE /y c:\windows\cookies\*.* > NUL
    DELTREE /y c:\windows\applic~1\micros~1\office\recent\*.* > NUL
    DELTREE /y c:\windows\applic~1\micros~1\intern~1\UserData\*.* > NUL
    if exist c:\windows\ff*.tmp del c:\windows\ff*.tmp
    if exist c:\windows\temp\*.tmp del c:\windows\temp\*.tmp

  7. Make sure you didn't make any typos!!! Click File, Save, File, Exit in the MS-DOS Edit window and you will be returned to the C:\> prompt in the MS-DOS window. Type exit and hit return to close the MS-DOS window.
  8. Restart your computer, and note that startup time may be slightly longer than before due to the execution of the new autoexec.bat file. Also, upon each subsequent startup, your computer will clean out the index.dat files as well as remove any new garbage.
  9. After restarting your computer, repeat step two and compare these numbers with the original numbers to see the disk space reclaimed. How much disk space did you reclaim? I reclaimed around 2MB the first go... really amazing, on top of the fact that the new autoexec.bat stops those "Username, click here..." ads from using your username!
  10. If you encounter serious computer problems or just don't like the effects of the new autoexec.bat file, then simply undo the above as shown below, using your startup disk to boot your computer if necessary. To use your startup disk to boot your computer, just stick the disk in the floppy drive and restart your computer. To undo the above, click Start, Programs, MS-DOS Prompt. Type cd.. to get to the C:\> prompt, type copy autoexec.backupcopy autoexec.bat on the same line, hit return, type y and hit return if prompted, type exit, hit return, remove your startup disk if it is the floppy drive, and restart your computer to go back to the original settings.
Below is an example of my autoexec.bat file before and then after the above additional code was added. Your autoexec.bat file will likely look different, not necessarily wrong... just different.

Before

@ECHO OFF
PATH=c:\windows;c:\windows\command;c:\ibmtools;c:\;%MAINDIR%\bin32
LH DOSKEY
c:\essolo.com
set PATH=C:\texmf\miktex\bin;%PATH%

After

@ECHO OFF
PATH=c:\windows;c:\windows\command;c:\ibmtools;c:\;%MAINDIR%\bin32
LH DOSKEY
c:\essolo.com
set PATH=C:\texmf\miktex\bin;%PATH%
if exist c:\windows\smartdrv.exe c:\windows\smartdrv.exe 2048 16
DELTREE /y c:\windows\history\*.* > NUL
DELTREE /y c:\windows\tempor~1\Content.IE5\*.* > NUL
DELTREE /y c:\windows\temp\cookies\*.* > NUL
DELTREE /y c:\windows\temp\tempor~1\Content.IE5\*.* > NUL
DELTREE /y c:\windows\temp\history\History.IE5\*.* > NUL
DELTREE /y c:\windows\cookies\*.* > NUL
DELTREE /y c:\windows\applic~1\micros~1\office\recent\*.* > NUL
DELTREE /y c:\windows\applic~1\micros~1\intern~1\UserData\*.* > NUL
if exist c:\windows\ff*.tmp del c:\windows\ff*.tmp
if exist c:\windows\temp\*.tmp del c:\windows\temp\*.tmp

Enjoy!!!

Disclaimer: All information and code provided herein are without warranty of any kind, expressed or implied, including but not limited to the implied warranties of merchantability or fitness for any purpose. In no event shall ThinkDing or PhpDig be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits, or special damages, even if ThinkDing or PhpDig has been advised of the possibility of such damages.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 02-27-2004, 11:06 AM   #2
radroach
Green Mole
 
Join Date: Feb 2004
Posts: 2
Question What about windows xp?

How would you pull that off using windows xp or win2k?
radroach is offline   Reply With Quote
Old 03-05-2004, 11:55 AM   #3
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi radroach, and welcome to PhpDig.net!

I haven't used WinXP or Win2K enough to write a decent tutorial for those OS but there are a couple of pages here and here that you may find useful.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 03-05-2004, 12:28 PM   #4
radroach
Green Mole
 
Join Date: Feb 2004
Posts: 2
Smile Thanks

Yep all I had to do was to change the permissions thanks that helped.
radroach is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search working in Mozilla but not IE for PC mwaters Troubleshooting 2 01-16-2006 08:55 AM
clean dashes?? vispa How-to Forum 1 02-26-2005 07:24 PM
PHP dig not indexing site on clean install... mixonic Troubleshooting 1 06-28-2004 08:15 AM
phpdigCleanHtml clean too much Jer Mod Submissions 5 04-12-2004 02:57 AM


All times are GMT -8. The time now is 09:45 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.