QUILLET
asked on
Remote App failed to launch using MSTSCLib API
Hi,
I am using MSRDPClient in a c# winform application and can't get to launch a remote app.
The following code is working for opening a desktop control if I comment out rdp.RemoteProgram.RemotePr ogramMode = true;
Trying to launch a remote app using :
rdp.RemoteProgram.RemotePr ogramMode = true;
...
rdp.RemoteProgram.ServerSt artProgram (@"C:\Wind ows\system 32\calc.ex e", "", "", false, "", false);
nothing happens and the connected event is never fired.
The client dev environnment is VS 2010 on Windows 7 Pro SP1
The target environnement is WS2008R2,
The TS Server is WS2003
Thanks for helping me
I am using MSRDPClient in a c# winform application and can't get to launch a remote app.
The following code is working for opening a desktop control if I comment out rdp.RemoteProgram.RemotePr
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AxMSTSCLib;
namespace SampleRDC
{
public partial class Form1 : Form
{
// initialized in form1.Designer
// private AxMSTSCLib.AxMsRdpClient7NotSafeForScripting rdp;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
rdp.Server = txtServer.Text;
rdp.UserName = txtUserName.Text;
rdp.OnConnected += new EventHandler(rdp_OnConnected);
rdp.RemoteProgram.RemoteProgramMode = true;
//rdp.RemoteProgram2.RemoteApplicationName = "Calculator";
//rdp.RemoteProgram2.RemoteApplicationProgram = @"C:\Windows\system32\calc.exe";
rdp.AdvancedSettings7.ClearTextPassword = txtPassword.Text;
rdp.Connect();
}
catch (Exception Ex)
{
MessageBox.Show("Error Connecting", "Error connecting to remote desktop " + txtServer.Text + " Error: " + Ex.Message,MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
void rdp_OnConnected(object sender, EventArgs e)
{
rdp.RemoteProgram.ServerStartProgram(@"C:\Windows\system32\calc.exe", "", "", false, "", false);
}
}
}
Trying to launch a remote app using :
rdp.RemoteProgram.RemotePr
...
rdp.RemoteProgram.ServerSt
nothing happens and the connected event is never fired.
The client dev environnment is VS 2010 on Windows 7 Pro SP1
The target environnement is WS2008R2,
The TS Server is WS2003
Thanks for helping me
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.