batch-fileremote-desktopmstsc

login to remote using "mstsc /admin" with password


I want to use mstsc /admin to login to a server silently. My batch file reads the code as

mstsc /v:xxx.xxx.xxx.xxx /admin

But it ask me to enter password. Can anyone help me to skip this step?

I went on to Google and found this site. But I am very new to this stuff (scripting) and could not understand what to do with given code. Is it a vbscript file? Can I do the same thing with a batch file. Please elaborate and I request you to spoon feed. This is not my arena but still I am pushed to fight without weapons.

My basic need is to kick off all users from a remote desktop except mine to perform some maintainable work. Thanks.


Solution

  • It became a popular question and I got a notification. I am sorry, I forgot to answer before which I should have done. I solved it long back.

    net use \\10.100.110.120\C$ MyPassword /user:domain\username /persistent:Yes
    

    Run it in a batch file and you should get what you are looking for.