There are commercially available rat repellents, but their effectiveness is questionable. Sonic and ultrasonic devices often are considered either totally ineffective or are not practical rat repellents. For centuries, people have tried to find ways to repel or develop a "magic" trap that will eliminate rats. Humans are still searching.
There are two main types of pest rats in North America, the Norway rat and the roof rat. Roof rats are climbers and are also known as “ship’s rats.” Originating in Southeast Asia, these tree-climbing rats most likely came to Europe and then rode ships to North America. These rats are cautious and hide when they are not moving. This creates a biological barrier to developing a repellent.
The most successful rat in North America is the Norway rat. This rat, also known as the wharf rat or sewer rat, has spread throughout the most of North America. These rats are not as good at climbing as their roof rat cousins. On the ground level, there is usually ample food and harborage, or places to live.
Over the years, people have tried sprays, bad smells, repellent food and even predators. However, the rats' sense of smell is excellent, and they seem to be able to distinguish between food and repellents. They are rarely deterred by any type of repellents except physical barriers.
There is no substitute for closed doors, windows and screening to physically repel or keep rats out of structures.