General discussion

Locked

Batch File - delete tmp files

By JnA ·
Hello,
I am not familiar with batch files, so I post this question:
I would like to create a batch file which deletes all the temporary files that are older than a week (not only the files in the TEMP folder, all the tmp files) on the computers ofthe domain.
Thanks

This conversation is currently closed to new comments.

16 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Batch File - delete tmp files

by opatzg In reply to Batch File - delete tmp f ...

Simple batch instructions cannot give you date logic on file detail, you would need a program to do that. Most any language should be capable and easy enough to write.

Collapse -

Batch File - delete tmp files

by JnA In reply to Batch File - delete tmp f ...

Poster rated this answer

Collapse -

Batch File - delete tmp files

by Matt_S In reply to Batch File - delete tmp f ...

We schedule the windows disk cleanup utility to run, which removes tmp files.

Collapse -

Batch File - delete tmp files

by JnA In reply to Batch File - delete tmp f ...

I tried that on windows 2000, but i do not see this tool on windows nt. It's not really a problem since we are soon moving to 2k, but is there a way to centralize this cleanup so that the admin runs it when he wants for all the computers ? (Sorry i did not really have time to look at it)

Collapse -

Batch File - delete tmp files

by Cactus Pete In reply to Batch File - delete tmp f ...

You can use some creative writing to get batch files to figure out dates...but the program gets longer than it really needs to be. If you really want to see how to do date differences in the DOS command language, check out the dos batch newsgroups.

If you aren't against using VB Script, I'd recommend that route. You can use the built in datediff function.

Otherwise, go with Matt_S.

Collapse -

Batch File - delete tmp files

by JnA In reply to Batch File - delete tmp f ...

Poster rated this answer

Collapse -

Batch File - delete tmp files

by shmaltz In reply to Batch File - delete tmp f ...

Scripting will acomplish that for you.

Collapse -

Batch File - delete tmp files

by JnA In reply to Batch File - delete tmp f ...

Poster rated this answer

Collapse -

Batch File - delete tmp files

by cglrcng In reply to Batch File - delete tmp f ...

Follow the link to Langa.com below, pick the batch file you wish & open it and edit it accordingly. There are like 15 different batch files avail. there, I use them as is and have never had 1 single problem w/ any of them.

http://www.langa.com/cleanup_bat.htm

Good Luck.

Collapse -

Batch File - delete tmp files

by cglrcng In reply to Batch File - delete tmp f ...

Also found this link, which is just what you are looking for;
http://www.swynk.com/winscript/DOCS_Purge.asp

Back to Windows Forum
16 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums