The winds were measured by balloon. Two types were commonly used and a third was being introduced towards the end of the program.
The Jimsphere, named after its inventor James Scoggins,
is a two meter Radar
reflective sphere with 396 cones on the surface to stabilize the balloon during ascent. This
balloon is tracked by one to two Radars near the Cape. 1 The balloon takes about 65 minutes to
rise to altitude with wind data reported in 100 ft intervals. Pressure relief valves on the
balloon allow it to equalize pressure and maintain a constant volume and therefore a constant
rise rate of about 1000 feet per second.
(as noted by Bret Copeland in a comment the actual rise rate is ~ 1000 feet per minute)
1 the same C-band radars used to track the shuttle stack during ascent

The Jimsphere was to be replaced by
The Automated Meteorological Profiling System
(AMPS) High-Resolution balloon system measures wind
speed and direction up to about 56,000 ft. Meant to
replace the aging Jimsphere system, it is similar in most
aspects. This balloon is not Radar tracked, rather, it has
a small Global Positioning System (GPS) enabled flight
element to obtain wind components. The additional
weight of the flight element is responsible for the slight
decrease in average altitude.
It looks like a Jimsphere with an instrument package dangling from it.
Other required atmospheric properties and high-altitude winds were measured by Low Resolution Flight Elements:
The AMPS Low-Resolution balloon system is used to
measure thermodynamic data as well as wind data. Temperature, humidity, density, wind speed, and wind direction are reported for Space Shuttle use at 1000 ft
intervals. This balloon system utilizes a two meter latex balloon with a GPS enabled flight element hanging 70 ft
below. The Low-Resolution balloon system rises to about 100,000 ft in about 100 minutes.
It looks like a standard weather balloon. This photo shows its high-tech launching system.

(Personal photo)
A radar Doppler Wind Profiler was being tested at Kennedy Space Center but was not certified for use, at least when I left the job.
The 50 MHz Doppler Radar Wind Profiler (DRWP) is a ground Radar placed on a five acre octagon shaped field
located near the launch site. Wind data is derived using Radar reflections from background particulates in the
atmosphere and is measured in 476 ft (145 meter) intervals from 8,700 ft to 61,000 ft (2.67 to 18.6 kilometers). The
entire wind profile is measured every five minutes. Supplementary, 9.15 MHz Doppler Radar Wind Profilers can be
utilized to measure the wind every fifteen minutes from the surface to about 6,500 ft.

(Personal photo of the DRWP at Vandenberg)
And remember kids, be careful out there.

(Personal photo)
Sources