auto delete of temp files in windows\temp

auto delete of temp files in windows\temp

Post by David Kuse » Fri, 04 Sep 1998 04:00:00



Hello all,

I hate to pester all you experts with such an unimportant issue but I'm
curious about this little problem.

I was reading a PC magazine and saw this line to use to auto delete the
trash in windows/temp.

echo y | del c:\windows\temp\*.*

It works fine BUT!!
When I rem it out it hangs both Win 95 & 98.

rem echo y | del c:\windows\temp\*.*

You get this screen message ---

All files in the directory will be deleted!
Are you sure (Y/N)?

This is where it hangs

I have to use the step by step confirmation at boot up and answer no to this
line and then I can get into windows.

My question:

Is there a way to have a line to automatically delete the windows temp trash
and still be able to rem it out without completely removing the line??

Thanks for any suggestions.

Dave Kusel

 
 
 

auto delete of temp files in windows\temp

Post by MrScar » Fri, 04 Sep 1998 04:00:00


I don't have an answer for your question, but have you ever thought of using
the Maintenance Wizard under system tools instead?

 Start-> Programs-> Accessories -> System Tools

 Attila Szabo
 Microsoft-MVP (DTS)
 Bell Atlantic-Services Technician
  a.k.a.' MrScary '


>Hello all,

>I hate to pester all you experts with such an unimportant issue but I'm
>curious about this little problem.

>I was reading a PC magazine and saw this line to use to auto delete the
>trash in windows/temp.

>echo y | del c:\windows\temp\*.*

>It works fine BUT!!
>When I rem it out it hangs both Win 95 & 98.

>rem echo y | del c:\windows\temp\*.*

>You get this screen message ---

>All files in the directory will be deleted!
>Are you sure (Y/N)?

>This is where it hangs

>I have to use the step by step confirmation at boot up and answer no to
this
>line and then I can get into windows.

>My question:

>Is there a way to have a line to automatically delete the windows temp
trash
>and still be able to rem it out without completely removing the line??

>Thanks for any suggestions.

>Dave Kusel


 
 
 

auto delete of temp files in windows\temp

Post by Help » Fri, 04 Sep 1998 04:00:00


Right click on Internet Explorer icon on Desktop select properties then look
at the General tab Temporary Internet Files section hitting the delete files
button
hope that helped

>Hello all,

>I hate to pester all you experts with such an unimportant issue but I'm
>curious about this little problem.

>I was reading a PC magazine and saw this line to use to auto delete the
>trash in windows/temp.

>echo y | del c:\windows\temp\*.*

>It works fine BUT!!
>When I rem it out it hangs both Win 95 & 98.

>rem echo y | del c:\windows\temp\*.*

>You get this screen message ---

>All files in the directory will be deleted!
>Are you sure (Y/N)?

>This is where it hangs

>I have to use the step by step confirmation at boot up and answer no to
this
>line and then I can get into windows.

>My question:

>Is there a way to have a line to automatically delete the windows temp
trash
>and still be able to rem it out without completely removing the line??

>Thanks for any suggestions.

>Dave Kusel

 
 
 

auto delete of temp files in windows\temp

Post by Tetracty » Sat, 05 Sep 1998 04:00:00



>Is there a way to have a line to automatically delete the
>windows temp trash and still be able to rem it out without
>completely removing the line??

Yes, this pair of lines works better than the one you cite,

Quote:>which will not delete subdirectories under Temp:

  deltree /y c:\windows\temp
  deltree /y c:\temp

However, you should be aware of one problem with deleting temporary
files from the autoexec.bat startup file. During program installation,
some install routines place configuration files in the temp directory
which are accessed during a reboot. If you remove the files during the
reboot, the installation will not complete correctly.

A rule of thumb regarding temp files is: don't delete them while Windows
is running; don't keep them when Windows is not running. Of course,
there are lots of exceptions: you can prune the 0-length files, the very
old files, the files you know are dead, etc.

If you really do want to clean up your temp files from autoexec.bat,
then you can consolidate them into a single temp directory by including
the following two files in your autoexec.bat file:

   set temp=c:\temp
   set tmp=c:\temp

The second line will render the C:\Windows\Temp directory obsolete, and
you may remove it. Some programs and utilities may recreate it, but they
won't put anything there, and it will remain empty.

If you do this, then you only need the following line in autoexec.bat:

  deltree /y c:\temp

Good luck and HTH.

--
Tetractys

(Or you could follow MrScary's advice and simply run the Maintenance
Wizard (aka Windows Tune-Up) now and then, or from the Task Scheduler,
which is what I do.)

 
 
 

auto delete of temp files in windows\temp

Post by Ian William » Sat, 05 Sep 1998 04:00:00


The reason why it hangs and shows the Delete message is that the REM
statement only refers to the ECHO part because of the pipe ,'|'.

To stop it completely you have to rem both commands, e.g.

;echo y | ;delete

Also it's better to use deltree instead of del, then you don't get the "File
not found" message when there are no files to delete.

--
regards

Ian Williams

my e-mail address is invalid, subtract 14 to get the real one.


>Hello all,

>I hate to pester all you experts with such an unimportant issue but I'm
>curious about this little problem.

>I was reading a PC magazine and saw this line to use to auto delete the
>trash in windows/temp.

>echo y | del c:\windows\temp\*.*

>It works fine BUT!!
>When I rem it out it hangs both Win 95 & 98.

>rem echo y | del c:\windows\temp\*.*

>You get this screen message ---

>All files in the directory will be deleted!
>Are you sure (Y/N)?

<snip>
 
 
 

auto delete of temp files in windows\temp

Post by Tetracty » Sat, 05 Sep 1998 04:00:00



>Tetractys smashed these keys:

>>>Is there a way to have a line to automatically delete the
>>>windows temp trash and still be able to rem it out without
>>>completely removing the line??
>>Yes, this pair of lines works better than the one you cite,
>>which will not delete subdirectories under Temp:

>>  deltree /y c:\windows\temp
>>  deltree /y c:\temp
>Wait a second here...this command will delete the entire FOLDER,
>it's contents and any sub-folders.

Whoopsie!

What I *meant* to say was:

  deltree /y c:\windows\temp
  deltree /y c:\temp
  md c:\windows\temp
  md c:\temp

Quote:>Why would you want to delete the entire folder, then worry about
>Windows creating it again?

>>If you really do want to clean up your temp files from autoexec.bat,
>>then you can consolidate them into a single temp directory by
>>including the following two files in your autoexec.bat file:

>>   set temp=c:\temp
>>   set tmp=c:\temp

>>The second line will render the C:\Windows\Temp directory obsolete,
>>and you may remove it. Some programs and utilities may recreate it,
>>but they won't put anything there, and it will remain empty.
>Not necessarily. If a program expects the \Windows\Temp folder to
>exist, it could easily code for that folder and write to it, rather
>than the environment variable.

Theoretically, yes. But I've yet to find anything placed there.

BTW: If you do this, and then use:

   deltree /y c:\temp

don't forget the:

   md c:\temp

Duh, me.

 
 
 

auto delete of temp files in windows\temp

Post by Jack A » Sun, 06 Sep 1998 04:00:00


In addition to inserting rem,  change | to alt124 which is the alternate
method of entering a pipe symbol.  Hold alt and press 1 2 4 on numeric
keypad, then release alt.

An alt124 will remind you to put a pipe symbol there when unreming.
The way it now reads... a rem string is piped to the del c:.... part.
As I recall, redirection or pipe symbols cannot be used in a rem line.

j. ak


>Hello all,

>I hate to pester all you experts with such an unimportant issue but I'm
>curious about this little problem.

>I was reading a PC magazine and saw this line to use to auto delete the
>trash in windows/temp.

>echo y | del c:\windows\temp\*.*

>It works fine BUT!!
>When I rem it out it hangs both Win 95 & 98.

>rem echo y | del c:\windows\temp\*.*

>You get this screen message ---

>All files in the directory will be deleted!
>Are you sure (Y/N)?

>This is where it hangs

>I have to use the step by step confirmation at boot up and answer no to this
>line and then I can get into windows.

>My question:

>Is there a way to have a line to automatically delete the windows temp trash
>and still be able to rem it out without completely removing the line??

>Thanks for any suggestions.

>Dave Kusel

 
 
 

auto delete of temp files in windows\temp

Post by fsm » Sun, 06 Sep 1998 04:00:00


Make a batch file placing it in your root directory.  Use it at will.
fsm


>Hello all,

>I hate to pester all you experts with such an unimportant issue but I'm
>curious about this little problem.

>I was reading a PC magazine and saw this line to use to auto delete the
>trash in windows/temp.

>echo y | del c:\windows\temp\*.*

>It works fine BUT!!
>When I rem it out it hangs both Win 95 & 98.

>rem echo y | del c:\windows\temp\*.*

>You get this screen message ---

>All files in the directory will be deleted!
>Are you sure (Y/N)?

>This is where it hangs

>I have to use the step by step confirmation at boot up and answer no to
this
>line and then I can get into windows.

>My question:

>Is there a way to have a line to automatically delete the windows temp
trash
>and still be able to rem it out without completely removing the line??

>Thanks for any suggestions.

>Dave Kusel

 
 
 

auto delete of temp files in windows\temp

Post by Ian William » Sun, 06 Sep 1998 04:00:00


Quote:>What I *meant* to say was:

>  deltree /y c:\windows\temp
>  deltree /y c:\temp
>  md c:\windows\temp
>  md c:\temp

Why go through all this? All you need is

deltree /y c:\windows\temp\*.*

Then it leaves the named folders alone.

--
regards

Ian Williams

my e-mail address is invalid, subtract 14 to get the real one.

<snip>

 
 
 

auto delete of temp files in windows\temp

Post by Tetracty » Sun, 06 Sep 1998 04:00:00



>Why go through all this? All you need is

>deltree /y c:\windows\temp\*.*

>Then it leaves the named folders alone.

But I want the named folders under TEMP to be deleted, and
I still need to set the TEMP and TMP environment variables.

This leaves me with:

   SET TEMP=C:\TEMP
   SET TMP=C:\TEMP
   DELTREE /Y C:\TEMP
   MD C:\TEMP

--
Tetractys

 
 
 

auto delete of temp files in windows\temp

Post by Mike McGr » Sun, 06 Sep 1998 04:00:00




: Hello all,
:
: I hate to pester all you experts with such an unimportant issue but I'm
: curious about this little problem.
:
: I was reading a PC magazine and saw this line to use to auto delete the
: trash in windows/temp.
:
: echo y | del c:\windows\temp\*.*
:
: It works fine BUT!!
: When I rem it out it hangs both Win 95 & 98.
:
: rem echo y | del c:\windows\temp\*.*
:
:
: You get this screen message ---
:
: All files in the directory will be deleted!
: Are you sure (Y/N)?
:
:
: This is where it hangs
:
: I have to use the step by step confirmation at boot up and answer no to this
: line and then I can get into windows.
:
: My question:
:
: Is there a way to have a line to automatically delete the windows temp trash
: and still be able to rem it out without completely removing the line??
:
:
: Thanks for any suggestions.
:
: Dave Kusel
:

There are lots of fixes listed for your batch problem in the above
messages BUT do not run this in your autoexec.bat file.  Only use it
AFTER you have successfully booted up to win98.  It can mess up the
installation of some newly installed programs, that require a
reboot/restart.  Some of them place update batch/program files in your
temp directory, and if you just delete everything then the proper
installation of the programs will fail with unknown results.

 
 
 

auto delete of temp files in windows\temp

Post by Tetracty » Mon, 07 Sep 1998 04:00:00



>deltree /y c:\windows\temp\*.*

>This command will delete all files and folders in the Temp folder
>WITHOUT deleting the Temp folder itself. Then you don't need to
>make the folders again.

Gotcha. Will change my REMed-out AutoExec lines.

Quote:>Do you monitor the default folder for files when you're using the
>computer, or are you just looking there from time to time to see if
>anything was left there?

The latter. I've never monitored the folder. I do just leave it alone
now, though, having seen it recreated so many times I'm tired of
deleting it, and see no advantage in doing so.

Quote:>I don't bother with any changes to the temp variable - the default
>works just fine - so I don't know if any Win9x programs hard code
>to that folder or not. I just prefer to err on the side of caution. :)

Understood. I just didn't like seeing two Temp folders, and the default
for Windows (under Windows) isn't necessarily the default other programs
look for (under the root). Plus I like seeing the Temp folder out of
Windows. It gives me the illusion I have *some* control over what's
going on.

--
Tetractys

 
 
 

auto delete of temp files in windows\temp

Post by Raneman- » Thu, 10 Sep 1998 04:00:00


Quote:> There are lots of fixes listed for your batch problem in the above
> messages BUT do not run this in your autoexec.bat file.  Only use it
> AFTER you have successfully booted up to win98.  It can mess up the
> installation of some newly installed programs, that require a
> reboot/restart.  Some of them place update batch/program files in your
> temp directory, and if you just delete everything then the proper
> installation of the programs will fail with unknown results.

Mike:

Please name "one" program using the Autoexec.bat for
deltree/y C:\temp\
that will be fouled up in any way.

Thanks,

Gordon

 
 
 

auto delete of temp files in windows\temp

Post by Raneman- » Thu, 10 Sep 1998 04:00:00


to delete the files in the temp folder simply, but not delete the
much needed temp folder:

deltree/y c:\temp\

Gordon

 
 
 

auto delete of temp files in windows\temp

Post by Raneman- » Thu, 10 Sep 1998 04:00:00



> >What I *meant* to say was:

> >  deltree /y c:\windows\temp
> >  deltree /y c:\temp
> >  md c:\windows\temp
> >  md c:\temp

> Why go through all this? All you need is

> deltree /y c:\windows\temp\*.*

> Then it leaves the named folders alone.

> --
> regards

> Ian Williams

> my e-mail address is invalid, subtract 14 to get the real one.


> <snip>

you don't need the *.* as you have already deleted the "tree in the
folder" which is everything after the folder deltree/y C:\temp\ ....

Gordon

 
 
 

1. Deleted Temp Files from C:Windows/Temp folder

I clicked my computer, the C drive, the windows folder,
then the temp folder, clicked Edit pull down menu, clicked
select All, verified that I was in the C:/windows/temp
folder and then lastly hit the delete key. All files were
deleted, except the ones in which the computer asked me if
I was sure I wanted to delete a file because it could
cause problems when running certain programs; so I
prompted the computer not to delete these (about 4)
folders. However, all the rest are deleted and now my
daughter tells me I probably deleted things I needed
because that is not how you delete TEMP files from windows
98. Is this true? If so, I thought anything in the TEMP
folder was just backup files or temporary unnecessary
files. Should I undo this?  Thanks Jack

2. ** FS: Z2i busboard, Aura-soundcard & lots more **

3. win98 temp file - delete all temp files?

4. Predicting markets with strong trends

5. Explain what I can delete in c:\Temp or c:\windows\temp?

6. File Transfer Manager: Resume failed transfer?

7. TEMP files now in Windows directory instead of TEMP !!

8. Plextor 8X4X32

9. Auto delete temp files?

10. How to Move c:\windows\temp to d:\windows\temp?

11. Temp folders in windows/temp

12. deleting temp files in Windows 2000?