How to create a batch file to connect to Remote desktop and launch Microsoft Sql server and run some scripts. I tried creating a batch file to connect to using
@ECHO OFF
mstsc /v:"SERVERNAME"
But i was not able to pass username and password Can anyone advise on this.
EDIT
psexec \\remotemachine-u username -p password ipconfig
Above one connects me to the remote machine and prints its Ip details.
Now I am trying to execute SQL script which is in D:\ of remote machine to execute in Microsoft SQL server (connection) in the remote machine. Is that possible.