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:


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.


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.