Bright lights have had some success in repelling bats. On commercial buildings, flood lights can be pointed at the bats’ entry points to keep them from entering. (Of course, the bright lights may attract insects too, which is the bats’ food.)
Attics can be illuminated with four or more bulbs or flood lights; ensure that all corners of the attic are illuminated.
Drafts of cool air from fans and air conditioners have, on occasion, kept bats from roosting in a poorly sealed attic.
Ultrasonic devices do not repel bats for long, so why use them? Try loud, heavy metal music!