Encrypt connection when using sqlcmd
The first one failed because the -E flag is for Trusted Connections (Windows Auth) and -U/-P flags are for SQL Authentication. These are mutually exclusive and cannot be combined.

The third one failed because -Q must be followed immediately by the query you wish to execute. In your provided code, you've included other flags between -Q and the actual query.

The second one should work syntactically, so you need to investigate the cause of the 


  The target principal name is incorrect


error. Take a look at some of the answers to this question and also validate that you can connect via SSMS, or you get the same error in SSMS.