For: Windows 95 / Windows 98
Published: ? | Last Updated: 16Mar02 | Status: Discontinued
I. Introduction
II. Important Notes Before Starting
III. Editing Autoexe.bat
I. Introduction
Autoexec.bat is a Windows 95 and Windows 98 (Windows 9x) file located in one's Boot Drive root directory, usually C:\. In the old days one made entries into autoexec.bat so old 16-bit Windows applications would run in the Windows 9x 32-bit environment.
For our purposes, though, all one needs to know about autoexec.bat is that Windows 9x starts by booting to DOS, that autoexec.bat (automatically executed batch file) is read during the boot process, and that any commands located within autoexec.bat will be executed.
DELTREE is a DOS command which can delete files and/or folders. To automatically delete files/folders during bootup, statements containing the deltree command will be added to autoexec.bat.
The path indicated in a deltree statement determines what will be deleted. More specifically, the following should be considered.
Note: Autoexec.bat is read while one's computer is in DOS-Mode. Therefore, any path specified in a deltree statement must be a DOS path. DOS allows only eight letter folder names, eight letter filename prefixes, and three letter file extensions. For example, the Window's folder c:\program files\ becomes c:\progra~1\ in DOS, and the Window's file longfilename.extension becomes longfi~1.ext in DOS.
There are a number of files and folders one might want to delete every time one's computer is booted. The following are covered in this post.
Note: For mailServerUserName substitute one's mail server user name as found in c:\progra~1\netscape\users\.
The command line switch, /y, will be used in conjunction with the deltree command as follows:
deltree /y c:\afolder\filename.ext
The use of /y avoids DOS prompting one to confirm the deletion of the file(s)/folder(s) specified in the deltree statement. For more on deltree.
II. Important Notes Before Starting
Editing autoexec.bat can cause some problems. In the event that it does, the following is provided so one can easily restore autoexec.bat to its original state.
Important Note: The version of autoexec.bat found at C:\ is quite different than the version found on the Windows StartUp Disk. So, yes, if one wants their Windows StartUp Disk to function, one must copy C:\autoexec.bat to a different floppy.
III. Editing Autoexe.bat
@TYPE INSTOS.MSG
SET PATH=D:\Perl\bin;%PATH%
Note: Of course one is free to add to, and to subtract from, the deltree statements mentioned. Just make sure the path is DOS, and that the path is deleting the file/folder one wants.
@TYPE INSTOS.MSG
SET PATH=D:\Perl\bin;%PATH%
deltree /y c:\recycled\*.*
deltree /y c:\windows\cookies\*.*
deltree /y c:\windows\history\*.*
deltree /y c:\windows\recent\*.*
deltree /y c:\windows\tempor~1\content.ie5\*.*
deltree /y c:\progra~1\netscape\users\mailServerUserName\cache\*.*
deltree /y c:\progra~1\netscape\users\mailServerUserName\cookies.txt
deltree /y c:\progra~1\netscape\users\mailServerUserName\netscape.hst
A special thanks to grilled cheese for suggestions/corrections.