webdork
asked on
Automation File Delete
I need an automated routine that will fire at midnight and delete every file in a specific folder.
Can someone point me at the right application?
.bat file?
Powershell?
Can someone point me at the right application?
.bat file?
Powershell?
batch files are a good starting point. The open source program xdel offers quite a bit of extended functionality on delete operations as well.
Oh and you'll want to use Scheduled Tasks to execute the batch file (even while a user is logged off, make SURE you end up entering a username and password).
Yes, a BAT file could be a good solution to this. It could be as simple as:
Once you vreate the BAT file you can schedule it with the Windows task scheduler, take a look at this tutorial.
http://www.makeuseof.com/tag/how-to-automate-windows-programs-on-a-schedule/
~bp
@echo off
del /Q "c:\temp\*.*"
if you wanted to remove all files in the c:\temp folder. If you need more elaborate criteria for the deletion like file size or age, then you may want to look at a more advanced script language like VB Script or PowerShell. Or look at some of the free utilities that exist and support that. I won't share any unless you come back with needs that require them.Once you vreate the BAT file you can schedule it with the Windows task scheduler, take a look at this tutorial.
http://www.makeuseof.com/tag/how-to-automate-windows-programs-on-a-schedule/
~bp
ASKER
Thanks billprew-- seems simple enough. What is the Q switch?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you. Simple is good...