SQLCMD can run a startup script defined by the environment variable SQLCMDINI.
Suppose you want to always execute the following query when you are connected to the server:
SELECT @@SERVERNAME, @@VERSION
Place this command inside the init.sql file and define the following environment variable:
C:\SET SQLCMDINI=c:\sqlscripts\init.sql