Using the following sqlcmd script:
sqlcmd -S . -d MyDb -E -s, -W -Q \"select account,rptmonth, thename from theTable\"
> c:\\dataExport.csv
<
The guy with the top answer didn't answer how to remove the dashed line. This is my awesome solution.
Sorry I'm 4 years and 9 months late.