Determination of $W$ boson properties at hadron colliders