Help with deletion of files in XP at bootup

P

programmernovice

Hi, I recently arrived at Windows XP after many years of Win98. In
Win98 I was able to insert 4 statements into Autoexec.bat file to erase
Cookies, Temp, History, and Temp. Internet Files from my drive at
bootup. XP has no such .bat file. I read here that it is possible to
accomplish the same in XP with something called a "batch file", or by
modifying registry, etc. As I am totally new to this, I would greatly
appreciate a detailed description of how to set it up, the proper
commands to enter, the way to create or modify the required executable
files, etc.

An example of the commands in Win98 Autoexec file:
c:\windows\command\deltree /y c:\windows\cookies

That would eliminate the "cookies" file. This worked perfectly every
time, and Windows just re-created the deleted files.

All help greatly appreciated.
 
R

Richard Urban

Simple advice.

Do not automatically delete temp files on boot up to Windows. There may be
programs you have installed that need these files to complete the
installation.

Delete the files after the computer has arrived at a stable desktop
environment, and the hard drive has quieted down to almost no activity (see,
that little blinking light on the front of the computer case really is
"good" for something).

--
Regards,

Richard Urban
Microsoft MVP Windows Shell/User
(For email, remove the obvious from my address)

Quote from George Ankner:
If you knew as much as you think you know,
You would realize that you don't know what you thought you knew!
 
K

Ken Blake, MVP

Hi, I recently arrived at Windows XP after many years of Win98. In
Win98 I was able to insert 4 statements into Autoexec.bat file to
erase Cookies, Temp, History, and Temp. Internet Files from my drive
at bootup. XP has no such .bat file. I read here that it is
possible to accomplish the same in XP with something called a "batch
file",


Just to clarify, autoxec.bat *is* a batch file. If differs from other batch
files (all of which are identified as batch files by the extension .bat)
only by running automatically at startup (in Windows 98).

The others are OK if you want to delete them automatically, but deleting the
contents of the temp folder from autoexec.bat was a very bad thing to do in
Windows 98, and doing anything similar remains a bad thing to do in Windows
XP. That's because there are some program installations which work in two
steps. The first step concludes by writing temporary files and rebooting.
The second step starts automatically after rebooting and needs to find those
files there (and then deletes them when it's done). If they aren't there,
the installation will fail.

If you want to delete the other files automatically from a batch file, just
create a text file with Notepad, containing the same statements you used to
put into autoexec.bat, and save it with whatever name you want and the
extension .bat. In notepad, put the name.bat in quotation marks so Notepad
won't append an extra .txt. Either put that file into F:\Documents and
Settings\Your Use Name\Start Menu\Programs\Startup or put a shortcut to it
there. That will have it execute at startup.
 
P

programmernovice

Thanks for your reply.
Just to clarify, autoxec.bat *is* a batch file. If differs from other batch
files (all of which are identified as batch files by the extension .bat)
only by running automatically at startup (in Windows 98).

The others are OK if you want to delete them automatically, but deleting the
contents of the temp folder from autoexec.bat was a very bad thing to do in
Windows 98, and doing anything similar remains a bad thing to do in Windows
XP. That's because there are some program installations which work in two
steps. The first step concludes by writing temporary files and rebooting.
The second step starts automatically after rebooting and needs to find those
files there (and then deletes them when it's done). If they aren't there,
the installation will fail.

OK thanks.
If you want to delete the other files automatically from a batch file, just
create a text file with Notepad, containing the same statements you used to
put into autoexec.bat, and save it with whatever name you want and the
extension .bat.

I tried this but apparently the statements or switches or whatever are
not recognized in the same form by XP. Is there a good source for the
proper statements that XP will recognize?

In notepad, put the name.bat in quotation marks so Notepad
won't append an extra .txt. Either put that file into F:\Documents and
Settings\Your Use Name\Start Menu\Programs\Startup or put a shortcut to it
there. That will have it execute at startup.

Many thanks for your help again.
 
K

Ken Blake, MVP

I tried this but apparently the statements or switches or whatever are
not recognized in the same form by XP.


It should be identical, except that some of the paths might be different.

Is there a good source for the
proper statements that XP will recognize?


Post what you tried here, and we'll take a look at it.

Many thanks for your help again.


You're welcome. Glad to help.
 
P

programmernovice

It should be identical, except that some of the paths might be different.




Post what you tried here, and we'll take a look at it.
OK here are my statements in Autoexec.bat (Win98)

C:\Windows\command\deltree y/ c:\windows\cookies
C:\Windows\command\deltree y/ c:\windows\history
C:\Windows\command\deltree y/ c:\windows\tempor~1
C:\Windows\command\deltree y/ c:\windows\temp

This worked well for many years, kept my machine clean and uncluttered.
Many thanks for your patience, Ken.
 
K

Ken Blake, MVP

OK here are my statements in Autoexec.bat (Win98)

C:\Windows\command\deltree y/ c:\windows\cookies
C:\Windows\command\deltree y/ c:\windows\history
C:\Windows\command\deltree y/ c:\windows\tempor~1
C:\Windows\command\deltree y/ c:\windows\temp


Deltree is one of the few older commands not available in Windows XP.

Also, the paths are different. Try these statements, substituting your user
name for mine:

Del /q/s "C:\Documents and Settings\Ken\Local Setings\Cookies\*.*"
Del /q/s "C:\Documents and Settings\Ken\Local Setings\History\*.*"
Del /q/s "C:\Documents and Settings\Ken\Local Setings\Temp\*.*"

This worked well for many years, kept my machine clean and
uncluttered. Many thanks for your patience, Ken.


You're welcome. Glad to help.
 
P

programmernovice

Deltree is one of the few older commands not available in Windows XP.

Also, the paths are different. Try these statements, substituting your user
name for mine:

Del /q/s "C:\Documents and Settings\Ken\Local Setings\Cookies\*.*"
Del /q/s "C:\Documents and Settings\Ken\Local Setings\History\*.*"
Del /q/s "C:\Documents and Settings\Ken\Local Setings\Temp\*.*"
OK Ken. I will try this and let you know how it works. Unfortunately
it will be a few days because I had to return my XP computer. I
noticed you left off the statement involving Temporary Internet Files.
Should it be the same as the others except for the "tempor~1" name?

Thank you again for being so helpful to me.
 
K

Ken Blake, MVP

Ken Blake, MVP wrote:

OK Ken. I will try this and let you know how it works. Unfortunately
it will be a few days because I had to return my XP computer. I
noticed you left off the statement involving Temporary Internet Files.
Should it be the same as the others except for the "tempor~1" name?


Sorry, yes Del /q/s "C:\Documents and Settings\Ken\Local Setings\Temporary
Internet Files\*.*"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top