At the state election in November 1851, he was elected New York State Treasurer on the Whig ticket by a margin of only 228 votes (200,693 for Cook; 200,465 for Welch), and took office on January 1, 1852.
He was New York State Comptroller from 1854 to 1855, defeated for re-election in 1855 by the American Party candidate Lorenzo Burrows.