Worms can end up on driveways, sidewalks and even in garages under a variety of conditions. Depending on the type of worm, this may not necessarily be a problem, but there are several methods to keep worms off the driveway and in the yard, where they can be beneficial.

...
Many worms are beneficial to lawns and gardens but often end up in the driveway

Identify the Worms

Most worms that find their way onto the driveway are earthworms. Earthworms are very beneficial to soil and are not harmful in the least. Other worms, such as sand worms and red worms, may not be desirable to have around. Identifying the worms on the driveway will dictate the best course of action, but this process is not always easy. Assistance with identification can often be done through local fish and wildlife departments and cooperative extensions of local universities.

Locate the Access Path

Worms may be crawling out of the lawn directly onto the driveway, particularly if the lawn and the driveway meet. However, it's more likely that worms are being washed into the driveway by irrigation or rainfall. Worms breathe through their skin and require moisture for that purpose, therefore it's not in their best interest to remain on pavement for long unless there is standing water. The very best course of action in reducing the worms found on the driveway will be to make sure there is proper drainage for any water that may end up on the driveway. This includes runoff from downspouts, excess water from car washing and drainage from sprinkler systems in adjacent flower beds and lawns.

Correcting Drainage Issues

It is not always possible to modify the grade of a driveway, particularly in the case of a paved or concrete driveway, though this is often the best way to fix drainage issues. Alternatives include rerouting downspouts to drain directly to the lawn or flower beds and installing a drain in the driveway. The latter requires cutting up a section of the driveway and burying a drain pipe -- that solution may require a professional.

Pest Control Solutions

If the worms on the driveway are not a beneficial type, or if they are appearing in large numbers even after correcting drainage issues, it may be necessary to implement other control measures. Start with products that are not otherwise damaging to the surrounding plants and animals. Salt will discourage worms, just as it does slugs, from crossing a certain point. Simply spread a thin line of salt at the edge of the driveway where the worms would pass over. This is not a permanent solution, however, as the salt will wash away over time. Chemical products can be found at home improvement stores for worm control, similar to those used for slug control, but these can also be harmful to pets and children, so care should be taken in their use.