Re: Temp files

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On 3/14/2007 5:14 PM On a whim, Dr. Dos pounded out on the keyboard

db wrote:
*hello dr. dos,*
** *drdos brings back*
*memories....*
** *i'm wondering if you*
*haven't considered simply making*
*a batch file to delete*
*those particular files*
*from that particular *
*directory.*
** *if i'm not mistaken, you*
*can launch the bat file*
*via a desktop shortcut or*
*run via msconfig or as*
*a scheduled task.*
** *- db*

"Dr. Dos" <DrDos@xxxxxxxxx <mailto:DrDos@xxxxxxxxx>> wrote in
message news:uD2kS1mZHHA.5044@xxxxxxxxxxxxxxxxxxxxxxx
documents and settings\xxxx\local settings\temp

Is there any way to have these automatically deleted?

On a daily basis I wipe out the clutter manually and would
like these them cleared on their own. I understand that
several are required for that particular boot session (mine
start with ~DFxxxxx.tmp), but these also remain when they
are no longer needed. Lots of other tmp files and
directories magically appear and never go away until I
delete them.
No, have not thought about that.
Problem with doing it that way multi-fold I predict:
In the temp directory are sub-directories, but not always the same ones and not always known directories. So, a batch file would have to delete the content of the sub-directories first, and then the directories themselves. A missing directory will produce a "file not found" halt. A new or unknown sub-directory will escape extinction.
For those files that end in .tmp, at least two of them are active system files. These active files have randomly assigned names. Unfortunately for me, other of these (expired) files ~Dxxxxxx.tmp, also clutter from previous sessions. There is no way to split out present from past *.tmp (unless I can building a batch file that takes note of date stamp and that won't work because of multiple daily routine reboots.)

So. I am still looking for a clean-up tool for the temp sub-directory, or a setting in windows that performs the cleanup.

Ah yes DR Dos, the non-Microsoft/non-IBM disk operating system alternative. I think the DR stood for Digital Research. The last version was DR Dos 7. Novell bought it about the same time it bought WordPerfect. DR Dos is still alive and living in Utah. WordPerfect is still alive and living in Canada. And Novell is still alive and living in Massachusetts. So much for geography.

I always change the temp locations to a folder right off the root ie: c:\temp (right click on My Computer, select Properties, Advanced tab, Environment Variables button, Edit both TEMP & TMP for User and System)

Do a Google search for Deltree.exe, used in Win9x versions. It works fine in W2K/XP. Create a batch file and add the line:
path\deltree.exe /y c:\temp\
where path is the location of deltree.exe. Put a shortcut to the batch file in your Startup folder and it will clean your temp folder on startup (after any install/update processes have run).

I've used the DEL command but it won't delete sub folders, only the data in the sub folders. i.e.:
del /s /q %temp%\*.*

I've seen others delete the temp folder and re-create it in a batch file, but I prefer deltree.
rd c:\temp
md c:\temp

Hope this helps,

--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
.



Relevant Pages

  • Re: Fax service, aloert when folder populated
    ... > I was hopeing I could get a batch file that sends a net ... > folder, see's something new is there and sends a net send ... It ignores old faxes, so you can delete ... if exist temp rd /s /q temp ...
    (microsoft.public.windows.server.general)
  • Re: Need Help with a DOS script (if possible)
    ... I'm looking for a way using a DOS batch file to take a folder and search ... use the 'SendTo' option and have the shortcut to the batch file in there.. ... Unfortunately DOS cannot do this sort of thing. ... remove the word "echo" in line 4. ...
    (microsoft.public.windowsxp.general)
  • Re: dos batch programmer help!!
    ... and i want to backup my xxx folder to external hd ... i want to write a batch file that before using xcopy to copy the xxx ... At least not without the help of an external program that ... I'm pretty sure DOS 6.2 had that. ...
    (comp.os.msdos.programmer)
  • Re: GRAHAM MAYOR - Re: Macro in Normal.dot prevents Word opening
    ... As far a batch files go, this is one I use to delete the annoying temp ... The temporary files are created in any document folder related to an open ... The Windows Temp folder (C:\Documents and Settings\\Local ... If you are creating the batch file ...
    (microsoft.public.word.vba.general)
  • Re: Delete temp files on start, program
    ... When I Google this, I get all sorts of things which I don't ... That will remove all files in the temp folders/subfolders, ... empties the temp folders without removing the folder. ... Once you have created the batch file and tested it, ...
    (microsoft.public.windowsxp.general)