I am not sure I understand your problem. What is the code you are running that does not work? Because running sqlcmd -E -S.\Server is connecting to the local server\instance that is what the 1> means. That is where you then execute your T-SQL statements followed by a GO when you have completed the batch.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question