1

I've an RDP file that successfully start a RemoteApp.

remoteapplicationmode:i:1
remoteapplicationprogram:s:||application
remoteapplicationname:s:application.exe
remoteapplicationcmdline:s:
authentication level:i:2
gatewayusagemethod:i:2
gatewayprofileusagemethod:i:1
gatewaycredentialssource:i:0
full address:s:aaa.bbb.ccc.com

I tried to copy its settings into my C# objects:

AxMsRdpClient7NotSafeForScripting rc = new AxMsRdpClient7NotSafeForScripting();
rc.OnConnected += (_1, _2) => { rc.RemoteProgram2.ServerStartProgram("application.exe", "", "%HOMEDRIVE%" + "%HOMEPATH%", true, "", true); };
rc.RemoteProgram2.RemoteProgramMode = true;
rc.RemoteProgram2.RemoteApplicationProgram = "||application";
rc.RemoteProgram2.RemoteApplicationName = "application.exe";
rc.TransportSettings.GatewayUsageMethod = 1;
rc.TransportSettings.GatewayProfileUsageMethod = 1;
rc.TransportSettings.GatewayCredsSource = 0; 
rc.Server = "aaa.bbb.ccc.com";
rc.UserName = "DOMAIN\\user";
rc.AdvancedSettings7.PublicMode = false;
rc.AdvancedSettings7.ClearTextPassword = "pass";
rc.AdvancedSettings7.AuthenticationLevel = 2;
rc.DesktopWidth = SystemInformation.VirtualScreen.Width;
rc.DesktopHeight = SystemInformation.VirtualScreen.Height;
rc.AdvancedSettings7.SmartSizing = true;
rc.Connect();

I've been searching everywhere but I wasn't able to find any example of how to launch a RemoteApp programmatically.

I've red this page, but it was not very helpfull. The client (a COM control) is connecting successfully, but it just displays a blue screen and no RemoteApp is launched.

Furthermore, I'm not sure that the right method to launch rc.RemoteProgram2.ServerStartProgram, because it takes paths as arguments, while in my RDP file no path is present!

Can anyone help me? I'm using the right objects to do what I want?

The server runs Windows Server 2008R2

Community
  • 1
  • 1
Paolo M
  • 11,431
  • 5
  • 51
  • 69

1 Answers1

0

If all you want to do is pragmatically launch a RemoteApp you already have an rdp file for, then just start it as a process:

System.Diagnostics.Process.Start(@"C:\Path_To_Rdp_File.rdp");
Ashigore
  • 4,468
  • 1
  • 17
  • 35
  • This is quite the same that launching mstsc... I'd like to launch the remote app as "an object" of my application. – Paolo M Apr 07 '14 at 11:28