We show how the entanglement of two atoms, trapped in distant separate cavities, can be generated with arbitrarily high probability of success. The scheme proposed employs sudden excitation of the atoms proving that the weakly driven condition is not necessary to obtain the success rate close to unity. The modified scheme works properly even if each cavity contains many atoms interacting with the cavity modes. We also show that our method is robust against the spontaneous atomic decay.