Windows Authentication by SQLCMD uses the current Windows identity with -E. It does not need a Windows password in the command.
SQL SERVER – Interesting Observation – Using sqlcmd From SSMS Query Editor
Turn on SQLCMD Mode and the SSMS Query Editor can run sqlcmd scripts that mix OS and SQL commands. The interesting part: the OS commands run first.


