I’m trying to create a fixlet that will delete any folder *McAfee\ from the C:\ drive.
How would I script this?
I’m thinking something like this.
IF {(exists (descendants whose (name of it contains “McAfee”) of folder “C:\McAfee”))
}
delete “C:\McAfee{(descendants whose (name of it contains “McAfee”) of folder “C:\McAfee”)}”
ENDIF
There are a couple approaches depending on where you want the logic. You could put the logic in action script or you could put the logic in powershell/batch.
-
using appendfile to write a batch file with a delete command for each old folder.
-
You could potentially write out a powershell script using get-item filter by date and pass it to a delete commandlet.
I would write relevance so that the task would only be relevant on computers where the folders exist.
exists folders whose(name of it ends with "McAfee" AND (now - modification time of it) > 1 * day ) of folders "C:\"
This should only be relevant if the folders exist and they are older than 1 day.
You could create a task that only deletes 1 of the folders at a time, and have it reapply every 15 minutes until all such folders are deleted.
This actionscript confuses me because this is to delete files, not the folder. What are you trying to do again?