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

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.

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