There are many ways to prevent cats from climbing on your car, including using specific scents, loud noises and movement. The best way to protect your car from cats is usually to cover the vehicle or to keep the cat inside.
Cats love to climb on top of things and they generally love warm places. This attracts them to parked cars, especially in sunny weather. However, they can track dirt onto clean hoods and windshields, and their claws can make scratches in the paint.
Loud noises and sudden motions are fairly effective ways to deal with cats. Many cat owners use spray bottles, shake cans filled with pennies, and make other loud noises and bold motions to discipline their cats. Those same techniques are effective for keeping cats away from cars. Eventually, cats learn to associate that place with negative consequences and will stay away on their own. If cats still won't stay away, car covers are good for protecting vehicles from scratches.
Cats don't like strong smells, so things like lemon juice and capsicum spray can repel them. However, although these remedies are natural and nontoxic, they are also slightly acidic and can wear away at a vehicle's finish. They also wash away in the rain and therefore need constant reapplication.
Another effective solution is to keep cats indoors. Although outdoor cats enjoy running through gardens in the fresh air, they have much shorter lifespans. They risk getting hit by cars and are more frequently exposed to bacteria and other illnesses. Therefore, keeping a cat inside protects the cat as well as any family vehicles.