1

I have published a remote app, MyApp.exe, from Server X. MyApp.exe can be launched with a variable optional parameter. That parameter can have a larger number of different values.

I have downloaded the RDP file from the gateway website that Server X publishes. I named the rdp file MyApp.rdp.

Is there anyway to pass a parameter to MyApp.exe running on Server X when I launch the RDP file? Something like this would be the most natural:

MyApp.RDP XYZ

This would run MyApp.exe on Server X passing it parameter XYZ.

I've looked all around the town and I can't find a clear yes or no or how-to for this question.

Jonathan Elkins
  • 113
  • 1
  • 4
  • Duplicate of [Is there a way to change command-line arguments in a signed RDP file?](https://stackoverflow.com/questions/9168788/is-there-a-way-to-change-command-line-arguments-in-a-signed-rdp-file) – you must change the `remoteapplicationcmdline:s:` in the rdp file or enable file associations. – Mitch Oct 10 '17 at 16:55

1 Answers1

2

You have a couple of options:

  1. Edit RDP File programmatically (See Is there a way to change command-line arguments in a signed RDP file?)

  2. Use a file association

  3. Use the /REMOTECMDLINE parameter of mstsc
    Ex: mstsc /REMOTECMDLINE:foo path\to\app.rdp will result in app.exe foo on the server

    You must remove the remoteapplicationcmdline:s: parameter from the rdp file lest you get the error message "This RDP file has settings that cannot be overridden by command line." You must also have "Allow any command-line parameters" selected on the app configuration on the server.

  4. Use the /REMOTEFILE parameter of mstsc

Mitch
  • 2,343
  • 14
  • 22