How Can I Pass a Variable Parameter to A Windows RemoteApp?

8,443

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

Share:
8,443

Related videos on Youtube

Jonathan Elkins
Author by

Jonathan Elkins

Updated on September 18, 2022

Comments

  • Jonathan Elkins
    Jonathan Elkins over 1 year

    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.