Sometimes, if it's one or two mice and you find the entry point. Snap traps placed along walls, no more than about 10 feet apart, with a small dab of peanut butter on the trigger, work better than anything sold as a repellent.
What most homeowners miss is the sealing. Mice fit through a 1/4 inch gap, and plastic, foam, rubber, and wood all get chewed through. Gaps need steel wool with caulk or metal (CDC, UC IPM). If you're still catching mice after two weeks, or you hear them in the walls, the entry points haven't been found.