Delete files from TEMP directory= c:\windows\system32\cmd.exe /c del %TEMP%\*.* /q


B

Bob Wang

A suggestion by Andrew deFaria got me to thinking about temporary files left
behind by applications other than Quicken.

I created a Scheduled Task that runs once a day, after Quicken's Scheduled
Update:

c:\windows\system32\cmd.exe /c del %TEMP%\*.* /q

HTH someone else

Bob
 
Ad

Advertisements

A

Andrew DeFaria

Bob said:
A suggestion by Andrew deFaria got me to thinking about temporary
files left behind by applications other than Quicken.

I created a Scheduled Task that runs once a day, after Quicken's
Scheduled Update:

c:\windows\system32\cmd.exe /c del %TEMP%\*.* /q

HTH someone else
That's a nice Windows based solution (BTW you don't need
C:\windows\system32 - just cmd.exe as that should always be in your
PATH). Couple of points:

* You might want to add a /s switch to remove all subdirectories
* You may or make not really wish to get rid of everything in
%TEMP%. I, for example, use %TEMP% for temporary storage. IOW I
may have something in there, for example, Firefox 3.0 Beta 1
Setup.exe, that I may wish to deal with but maybe not for a few
days. I don't want it being whacked away.
* The above simple approach does nothing for things that cannot be
deleted because they are currently in use. My script hides such
files by flipping on the hidden bit.

But in general I wish applications would be better about cleaning up
their mess in tmp. Quicken's a pretty bad offender...
 
B

Bob Wang

Andrew:

Good point, forgot that applications also create directories in the TEMP
folder.
So, the quick and dirty Scheduled Tasks I use are now two:

c:\windows\system32\cmd.exe /c del %TEMP%\*.* /q /s

c:\windows\system32\cmd.exe /c rd %TEMP% /q /s

Thanks for amplifying,
Bob
Bob Wang wrote:
A suggestion by Andrew deFaria got me to thinking about temporary files left
behind by applications other than Quicken.

I created a Scheduled Task that runs once a day, after Quicken's Scheduled
Update:

c:\windows\system32\cmd.exe /c del %TEMP%\*.* /q

HTH someone else

That's a nice Windows based solution (BTW you don't need
C:\windows\system32 - just cmd.exe as that should always be in your PATH).
Couple of points:

You might want to add a /s switch to remove all subdirectories
You may or make not really wish to get rid of everything in %TEMP%. I, for
example, use %TEMP% for temporary storage. IOW I may have something in
there, for example, Firefox 3.0 Beta 1 Setup.exe, that I may wish to deal
with but maybe not for a few days. I don't want it being whacked away.
The above simple approach does nothing for things that cannot be deleted
because they are currently in use. My script hides such files by flipping on
the hidden bit.

But in general I wish applications would be better about cleaning up their
mess in tmp. Quicken's a pretty bad offender...
 
A

Andrew DeFaria

Bob said:
Andrew:

Good point, forgot that applications also create directories in the TEMP
folder.
So, the quick and dirty Scheduled Tasks I use are now two:

c:\windows\system32\cmd.exe /c del %TEMP%\*.* /q /s

c:\windows\system32\cmd.exe /c rd %TEMP% /q /s

Thanks for amplifying,
Ugh! You still don't need C:\Windows\System32 - just cmd.exe, or even
shorter, just cmd.

And you don't want that second one. That says to remove the %TEMP%
directory altogether. Thereafter I suspect you'll see many failures in
software as they probably assume that %TEMP% already exists.

Finally, the first one, del %TEMP%\*.* /q /s is sufficient as it will
remove everything in %TEMP% including directories (due to the /s option).

Oh and it still doesn't get rid of files and directories that are open.
I'm assuming you don't care about that.

On a slightly off tangent note, I use Process Explorer from Sys
Internals (now part of MS) to find who has files/dirs still open. I find
a lot of ~DF<some number>.tmp and Perflib_Perfdata_<some number> files
hanging out in %TEMP%. I have no idea why such files are open and I use
Process Explorer to forcibly close them. It never seems to do any harm
to the processes themselves. Process Explorer itself often has one of
them Preflib files open. If anybody knows what causes such files to come
into existence and how one might configure them to not be created then
let me know. It seems to be related to performance related monitoring
and really I do not wish to monitory performance nor have to clean up
these silly files...
 
B

Bob Wang

YMMV.

1) The del /s command DOES NOT remove ALL directories for me.

2) I need the rd command to remove directories like __SkypeIEToolbar_Cache

3) And, precisely BECAUSE there's Perflib_Perfdata_e4c.dat, ~DFBFF1.tmp and
WCESLog.log in the TEMP directory, the TEMP directory itself is not deleted.

4) I include the full path and extension just for completeness sake.

Bob
P.S. Thanks for your input, but can we drop the subject now?
Bob Wang wrote:
Andrew:

Good point, forgot that applications also create directories in the TEMP
folder.
So, the quick and dirty Scheduled Tasks I use are now two:

c:\windows\system32\cmd.exe /c del %TEMP%\*.* /q /s

c:\windows\system32\cmd.exe /c rd %TEMP% /q /s

Thanks for amplifying,

Ugh! You still don't need C:\Windows\System32 - just cmd.exe, or even
shorter, just cmd.

And you don't want that second one. That says to remove the %TEMP% directory
altogether. Thereafter I suspect you'll see many failures in software as
they probably assume that %TEMP% already exists.

Finally, the first one, del %TEMP%\*.* /q /s is sufficient as it will remove
everything in %TEMP% including directories (due to the /s option).

Oh and it still doesn't get rid of files and directories that are open. I'm
assuming you don't care about that.

On a slightly off tangent note, I use Process Explorer from Sys Internals
(now part of MS) to find who has files/dirs still open. I find a lot of
~DF<some number>.tmp and Perflib_Perfdata_<some number> files hanging out in
%TEMP%. I have no idea why such files are open and I use Process Explorer to
forcibly close them. It never seems to do any harm to the processes
themselves. Process Explorer itself often has one of them Preflib files
open. If anybody knows what causes such files to come into existence and how
one might configure them to not be created then let me know. It seems to be
related to performance related monitoring and really I do not wish to
monitory performance nor have to clean up these silly files...
 
H

Han

P.S. Thanks for your input, but can we drop the subject now?
After all the foregoing, just alittle aside. Somewhere I found ATF
cleaner. Choose what to clean, and it's done very fast. It's publisher's
webpage (atribune.org) appears to be off right now, but Majorgeeks still
seems to have the download. Not sophisticated, but free.
 
Ad

Advertisements

A

Andrew DeFaria

Bob said:
YMMV.

1) The del /s command DOES NOT remove ALL directories for me.
You're right! It doesn't. I don't use del anyway - I use rm.
2) I need the rd command to remove directories like __SkypeIEToolbar_Cache

3) And, precisely BECAUSE there's Perflib_Perfdata_e4c.dat,
~DFBFF1.tmp and
WCESLog.log in the TEMP directory, the TEMP directory itself is not
deleted.
But you are relying on that. If someday they are not present, poof, your
%TEMP% is gone.
4) I include the full path and extension just for completeness sake. That's silly!
Bob
P.S. Thanks for your input, but can we drop the subject now?
You sir can drop it any time you want. I, sir, will do what I please. I
have no problems discussing technical issues. You seem to want to run,
duck and cover. Why is that? Why not discuss technical issues, points
and the like? What's wrong with that?
 
B

Bob Wang

SIGH!

You know, I TRY to be NICE by giving YOU some credit.

How you get clients is beyond me.

You're kill-filed AGAIN ;-)
Bob Wang wrote:
YMMV.

1) The del /s command DOES NOT remove ALL directories for me.

You're right! It doesn't. I don't use del anyway - I use rm.

2) I need the rd command to remove directories like __SkypeIEToolbar_Cache

3) And, precisely BECAUSE there's Perflib_Perfdata_e4c.dat, ~DFBFF1.tmp and
WCESLog.log in the TEMP directory, the TEMP directory itself is not deleted.

But you are relying on that. If someday they are not present, poof, your
%TEMP% is gone.

4) I include the full path and extension just for completeness sake.

That's silly!

Bob
P.S. Thanks for your input, but can we drop the subject now?

You sir can drop it any time you want. I, sir, will do what I please. I have
no problems discussing technical issues. You seem to want to run, duck and
cover. Why is that? Why not discuss technical issues, points and the like?
What's wrong with that?
 
B

Bob Wang

Han:

Thanks, I'll definitely look into ATF cleaner.

Bob
P.S. Thanks for your input, but can we drop the subject now?
After all the foregoing, just alittle aside. Somewhere I found ATF
cleaner. Choose what to clean, and it's done very fast. It's publisher's
webpage (atribune.org) appears to be off right now, but Majorgeeks still
seems to have the download. Not sophisticated, but free.
 
B

Bob Wang

Han:

Thanks for the tip.
Works like a charm.
So, forget my cludge. ;-)

Bob
P.S. Thanks for your input, but can we drop the subject now?
After all the foregoing, just alittle aside. Somewhere I found ATF
cleaner. Choose what to clean, and it's done very fast. It's publisher's
webpage (atribune.org) appears to be off right now, but Majorgeeks still
seems to have the download. Not sophisticated, but free.
 
B

Bob Wang

Han:

Can you start a new thread linking this utility?
I like how, when you run it under XP it says "ATF Cleaner for Windows XP"
When run under Vista it says "ATF Cleaner for Windows Vista"

TWO THUMBS UP!

Bob
P.S. Thanks for your input, but can we drop the subject now?
After all the foregoing, just alittle aside. Somewhere I found ATF
cleaner. Choose what to clean, and it's done very fast. It's publisher's
webpage (atribune.org) appears to be off right now, but Majorgeeks still
seems to have the download. Not sophisticated, but free.
 
Ad

Advertisements

A

Andrew DeFaria

Bob said:
SIGH!

You know, I TRY to be NICE by giving YOU some credit. Yes, next time try that...
How you get clients is beyond me.
Because I'm good at what I do. Damn good! That's why!
You're kill-filed AGAIN ;-)
Your loss...
 

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

Similar Threads


Top