I have written a batch file that part of its function is to initiate a remote desktop connection with another computer on the network. When the batch file gets to the remote connection command, the remote connect window appears and I have to press the "connect" button for the process to continue. The remote desktop app already has the address, and log on credentials in it. How can I have this connection happen as part of the batch file?
Below is the troublesome part of my batch file:
rem Runs Access with Autoexec macro that will generate updated parts table then exit
"C:Program FilesMicrosoft OfficeOfficemsaccess.exe" "C:webqueryparts.mdb" /excl
rem Starts Remote Desktop for webquery machine
%SystemRoot%system32mstsc.exe
Thanks!
-Flame
Software/Hardware used:
ASKED:
February 25, 2009 7:57 PM
UPDATED:
February 11, 2011 4:36 PM
If you right click on the remote connection executable you get remote desktop connection properties. On the shortcut tab modify the Target line, you can add the /v <computer name or ip address> at the end of the dos line that starts the rpc executable. This would then appear as %SystemRoot%system32mstsc.exe /v <computer name or ip address>. As long as you have saved the connection settings for the computer name or IP address of the desktop you are connecting to, this will work and you don’t need the batch file.
Forgot to say, this will make the connection when you then click the rpc shorcut with the modified target, without having to click the connect button.
or write your line in the batch file as %SystemRoot%system32mstsc.exe /v <computer name or ip address>