Unless regulated by the commissioner of the department of transportation as provided in N.H. Rev. Stat. § 236:1, the selectmen may regulate the use of all public highways, sidewalks, and commons in their respective towns and for this purpose may exercise all the powers conferred on city councils by N.H. Rev. Stat. § 47:17, VII, VIII, and XVIII, and by any other provisions of the laws upon the subject.