system
December 6, 2006, 9:52pm
1
(imported topic written by SteveC91)
I currently have an Analysis whose relevance finds certain files located on the c:\ of systems. I’d like to now take that information and run a fixlet or action to actually delete those files. Is there an automated way to move the results of the filenames (and the computers) to a fixlet or do I have to manually do this - ie write a fixlet that deletes the files then select the computers to run the fixlet against?
system
December 6, 2006, 10:25pm
2
(imported comment written by brolly3391)
Hello Steve,
You should be able to use the relevance from your analysis , slightly modify it and then use it in a fixlet.
For example, if the property in your analysis was something like
files whose (name of it ends with “.bmp”)of windows folder
you could write a fixlet to delete all those .bmp files like this:
relevance:
exists
windows folder
whose (exists
file whose (name of it ends with “.bmp” of it)
of it)
action:
delete __appendfile
appendfile del “{(pathname of it&”"&name of it) of
files whose (name of it ends with “.bmp”)of windows folder
}" /Q
copy __appendfile tempdel.bat
waitdetached tempdel.bat
delete tempdel.bat
If you are creating a local list of files to be deleted on each machine then you can use “lines of file” to parse that file into delete commands.
If you need more help, paste in the details of your analysis so we can figure out what approach might be best.
Cheers,
Brolly
system
December 7, 2006, 5:54am
3
(imported comment written by SteveC91)
That’s what I was “afraid” of. It would be nice to just pass the script the result to run against the computer. Off to cut & paste.
Thanks!
system
March 9, 2007, 9:07pm
4
(imported comment written by jessewk)
Hey that’s a great script. You should enter it in our contest.
http://forum.bigfix.com/viewtopic.php?id=695