Automatically Deleting Files on a Shared System

When presentation files quickly accumulate on a shared system, use this script to automatically delete them at reboot.

Bob Chronister

May 23, 2005

1 Min Read
ITPro Today logo in a gray background | ITPro Today

I'm in charge of a computer that company employees use to present Microsoft PowerPoint presentations. As you can imagine, the presentation files accumulate rapidly. Can you show me a simple way to delete the presentations automatically from this machine?

The solution to your problem is indeed simple. You need to give the presenters permission to copy files to only one location on this machine. For example, give the users designated as presenters permission to copy files to a desktop folder called Presentations. Then, write a simple script that contains the following code (which should all appear on one line):

CD C:Documents and   Settingsspeakers.DomainnameDesktopPresentations  Delete /Q *.*

The /Q option deletes all files without question. If you use the command in a logon script, each time the machine reboots, all files in the desktop folder would be erased. (Make sure presenters know to keep a copy of the presentation on their own computers.) Some third-party applications can perform this task for you, but most are very aggressive and delete more than just files.

—Bob Chronister

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like