Cayenne pepper can get rid of mice. However, there are other factors involved. You'll need to know how and where to use it. And by combining it with other substances, you can make it more effective.
Keeping mice away
Keeping your home clean by getting rid of things that attract mice is the best way to deter them. Mice are always looking for food, so make sure nothing has been spilt or made available for a hungry critter, especially under cabinets and places that are easy to hide in. Always clean up leftover food as soon as possible and sweep up crumbs on the floor.
Mice will also search for nesting and bedding materials. Old cloths and paper will be shredded to make nests that will eventually lead to breeding. A breeding population will only compound the problem by making any repellent that much more difficult to implement successfully.
Cayenne pepper plus
Cayenne pepper sprinkled around obvious mouse infestation areas will keep curious mice at bay. It can even be sprinkled in glove boxes of cars or in the engine compartment if there has been mouse activity in your vehicle. But in places that are difficult to get to, a good spray formula will be a better solution.
Try soaking horseradish, garlic and cayenne pepper in regular salad oil for about four days. Strain this mixture into a spray bottle and then liberally spray the mixture into or onto known mouse habitation areas. This solution can be sprayed in places you could not possibly get to with cayenne pepper, and the oil will make it stick on anything it touches.