On Shepard's second cruise with "Cogswell", he was appointed a gunnery officer, responsible for the 20 mm and 40 mm antiaircraft guns on the ship's bow. They engaged kamikazes in the Battle of Okinawa, where the ship served in the dangerous role of a radar picket. The job of the radar pickets was to warn the fleet of incoming kamikazes, but because they were often the first ships sighted by incoming Japanese aircraft, they were also the most likely ships to be attacked. "Cogswell" performed this duty from May 27, 1945, until June 26, when it rejoined Task Force 38. The ship also participated in the Allied naval bombardments of Japan, and was present in Tokyo Bay for the Surrender of Japan in September 1945. Shepard returned to the United States later that month.