Friday, 18 October 2019

c# - Command line RDP call CMD on target machine


I need to remote into ~50 machines and run a batch file. Is there any way I can start up an RDP session and call cmd?



Answer



If you need to use RDP to access these machines, there are shells for mstsc.exe that allow command line auto-login and running a program upon connection. One that comes to mind is Remote Desktop Plus. You could use a batch script to log in to the given machines with the following syntax:


rdp /v:computer /u:username /p:password /start:"pathtoscript/script.bat"

Download from http://www.donkz.nl/


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...