Remote Desktop with custom parameter

0

1

is there any way way to open the mstsc (remote desktop connection) with a custom parameter I initialized and then read it on the remote computer via command prompt?

I need to create batch file that will, open remote desktop and then automatically open another batch file that continues the process on the remote system if the parameter is initialized.

inon

Posted 2013-10-29T14:52:20.367

Reputation: 101

Why not just create a script which executes on logon on the remote machine?? – Dave – 2013-10-29T14:56:22.317

Because I don't want that the script will starts in every logon... – inon – 2013-10-29T14:57:41.857

As a work around, maybe you create a new user for the remote machine which is only used in the instance you want this behaviour... So the user becomes the parameter – Dave – 2013-10-29T15:07:31.343

@inon: A possible workaround might be to have a file on the client machine's hard drive that could be read through the appropriate path, e.g. \tsclient\C\Temp\File.txt by your batch file (tsclient resolves to the connecting machine and gives access to its disk drives if you choose to make them available when you connect) – James P – 2013-10-29T15:33:49.117

Answers

0

You should take a slightly different approach. Take a look at the PsExec utility. PsExec can run BATCH scripts on remote machines. So in your local BATCH script you would launch mstsc asynchronously, optionally wait a few seconds, then call PsExec to execute your second script remotely.

HairOfTheDog

Posted 2013-10-29T14:52:20.367

Reputation: 2 102

0

The comment of @James, is the best answer for me:

A possible workaround might be to have a file on the client machine's hard drive that could be read through the appropriate path, e.g. \tsclient\C\Temp\File.txt by your batch file (tsclient resolves to the connecting machine and gives access to its disk drives if you choose to make them available when you connect)

Thanks!

inon

Posted 2013-10-29T14:52:20.367

Reputation: 101