Using No Insecticides
If you had squash vine borers last year, then the best way to deal with them this year is to prevent the moth from getting to the stems of the plants where she needs to lay her eggs. You can cover the whole plant with Floating Row Cover called “Fleece”. Cover transplants or a newly seeded area with the material immediately after planting to prevent both insect damage and insect egg-laying. Lay the barrier material directly on the plants, seal all the edges to the ground with loose soil. Provide lots of extra material so when the plants grow larger they don't strain against the covering.
Try Aluminum Foil Wraps
Another strategy is to cover each of the stems up about 10 inches from the soil level with aluminum foil or with pieces of nylon stockings. Some gardeners have had luck putting an aluminum foil mulch around the vulnerable seedlings. This mulch apparently serves as a deterrent to the moths that lay eggs on the vine. It reflects the sky, disorientating the moths as they attempt locate the vulnerable plants by their color. The moths continue to search in other locations, not in your garden.
Remove By Hand
If the above steps fail and you find yourself with borers in your plants get out a small sharp knife. At the spot where the excrement or frass seems to be coming from, make a vertical slit as long as necessary to find and remove the grub or grubs; there may be several. Do not cut horizontally across the stalk. Kill the worms with the knife blade or a piece of wire. The wound may be left open, or soil may be mounded up over it to encourage the plant to put out roots above the wound. There may be grubs in the leaf stems as well as in the main stem. Remove all badly damaged leaf stems.
Try Diatomaceous Earth
Another approach is to use insecticide in a dust form to prevent the larvae from getting into the stems. Sprinkle Diatomaceous Earth around the base of plant to create a barrier for the pest, and dust the whole plant with it. Dusting should progress upward from the ground, covering all stems and leaves, especially on their undersides. Do this in the late evening, and predator insect destruction will be low. Replace after each rain.
Early Warning Trick
The moth or adult of the squash vine borer is attracted to the color yellow, according to the Mother Earth News. They suggest setting out a yellow pan of water among the plants. Moths will be found floating in the water, alerting you to their presence so you can begin to take preventive action. There is no reason yellow sticky traps would not work the same way. Go to Yardener's Tool Shed for Yellow Sticky Trap Products.
Using Natural Insect Repellents
There are several natural insect repellents that often kill the moth of the Squash Vine Borer on contact, but also serves as a repellent by creating a bad taste for the critter and make it go someplace else to munch and lay eggs. Neem Oil Soap, Hot Pepper Wax, and Garlic Barrier all have this potential repellent capability when applied properly on the tops and the bottoms of leaves of the target plant at least two weeks before you expect the Moth to arrive, probably around the first of May. The repelling effect will last for several weeks to a month depending on the weather conditions, so you may wish to add another application every two weeks or so. See the Natural Repellents in Yardener's Tool Shed.
Try Bt Injections
Once the borer is inside the stem they can be controlled by injecting the squash vine with Bacillus thuriengensis (BT). You can use a disposable hypodermic needle from the pharmacy (3-cc size will do) or even better a glue injector used in wood working. Timing is most important in using the injection method. Give plants their first inoculation just after the first flush of flowers appears. Shooting BT into the stems bathes the borers' food supply with bacteria. Infecting them just after they hatch prevents borers from doing much damage to the inside of the stem. Inject the plants again in a week to 10 days. The liquid form of BT works best. Mix it in normal solution just before you're ready to use it. Gardeners also recommend preparing a bowl of disinfectant such as chlorine bleach mixed with an equal amount of water, and using that solution and clean water to clean and rinse the syringe between injections. Cleaning the syringe between injections reduces the possibility of spreading disease from one plant to another. Stick the needle right into the center of the stem, about 1;1/2 inches above the soil line. This is approximately where the borers will feed first after hatching. The idea is to wash the hollow interior of the stem with BT so that the tiny borers eat it as they feed. Use about 1 cc of BT per injection. (If you inject too much, it will flow back out of the stem through the hole made by the needle.) It's fine to stick the needle into the holes left by borers that have already entered the stem, though the borers tend to move slowly upward as they feed. In advanced cases of infestation, it may be more effective to make the injection about an inch above the borer holes.