How Can I Pass a Variable Parameter to A Windows RemoteApp?
You have a couple of options:
Edit RDP File programmatically (See Is there a way to change command-line arguments in a signed RDP file?)
Use a file association
-
Use the
/REMOTECMDLINE
parameter ofmstsc
Ex:mstsc /REMOTECMDLINE:foo path\to\app.rdp
will result inapp.exe foo
on the serverYou 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. Use the
/REMOTEFILE
parameter ofmstsc
Related videos on Youtube
Jonathan Elkins
Updated on September 18, 2022Comments
-
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.
-
Oleg over 6 yearsDuplicate of 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.
-