I have this command
sqlcmd.exe -E -i \"C:\\joe-db-scripts\\joe-db-tasks.Install.sql\"
and I need to add the specific non-standard port of 32001
Following solution is working for me in SQL Server 2008 and above.
sqlcmd -S "hostname or IP,port number" -U SA -P password