Question Locked

Automatic file removal

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi Every one

Im looking for a application that removes files or applications automatic. Like whne antivirus finds a file it delets it automatic.

In my case its users and thier crap applications that i want them preventing from using within the network. So when the program detects it on their USB or home drive it delets it or move it to somewhere they dont have access.

4 replies

by mmauer

I wish I could ban USB sticks would save me a lot of time. Thats why i want some sort of program control system where I can deny them from applications.

by Former member

'-------------- CleanUp.vbs --------------------
Option Explicit
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
DeleteFiles fso.GetFolder("C:\Test") '<----- Change this folder name to match with your case.
Sub DeleteFiles(srcFolder)
Dim srcFile
If srcFolder.Files.Count = 0 Then
Wscript.Echo "No File to Delete"
Exit Sub
End If
For Each srcFile in srcFolder.Files
If DateDiff("d", Now, srcFile.DateCreated) < -7 Then
fso.DeleteFile srcFile, True
End If
Next
Wscript.Echo "Files Deleted successful"
End Sub
'-----------------------------------------------
To delete files that are more than 2 hours old:

Code:
...
For Each srcFile in srcFolder.Files
If DateDiff("h", Now, srcFile.DateCreated) < -2 Then
fso.DeleteFile srcFile, True
End If
Next
...

https://secure.reg.net/Product.asp?ID=11557&r=y&sessID=%7B213AEEF4-9BC0-4899-A682-8F3F5ACACF49%7D&TemplateID=-1
http://www.watchdirectory.net/wdhelp/plugins/wdopAutoDelete.html?src=godelete

Please post back if you have any more problems or questions.

This discussion is closed to new replies.