There is a way to do this using ActionScript and I’ve done it in the past using appendfile and concatenate to construct a batch file on the fly based on the individual values of the folders on each individual system then run the batch file.
delete __appendfile
if {exists files whose (name of it ends with ".log") of folder "Temp" of folder (pathname of windows folder)}
appendfile del /Q { concatenation "%0d%0adel /Q " of (pathnames of files whose (name of it ends with ".log") of folder of folder "Temp" of folder (pathname of windows folder))}
endif
if {exists files whose (name of it ends with ".log" OR name of it ends with ".cab") of folder "Logs\CBS" of folder (pathname of windows folder)}
appendfile del /Q { concatenation "%0d%0adel /Q " of (pathnames of files whose (name of it ends with ".log" OR name of it ends with ".cab") of folder "Logs\CBS" of folder (pathname of windows folder))}
endif
move __appendfile clean.bat
waithidden clean.bat
NOTE: I think this is a very hamfisted script but it should get you going.