Exhibit 23.1 CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM We hereby consent to the incorporation by reference in the Registration Statements on Form S-8 (No. 33-21735, No. 333-50293 and 333-131692) of KSW, Inc. of our report dated March 5, 2008, relating to the consolidated financial statements which are included in this Annual Report on Form 10-K. J.H. Cohn LLP White Plains, New York March 5, 2008