>I am able to run my application on terminal services if I do it by hand. i.e. I login in remotely via rdp, and then when the desktop appears, I run my app.
>
>This is too messy for my users...
>
>Is there a way to automate this?
>
>i.e.
>The user picks the location, and based on this selection, I connect to the remote location via terminal services and run my application.
>
>I found something here, or was it on WIKI, not sure, called tasc... but I can't seem to get it to work. It requires some ole control to be registered. (msrdp.ocx) I tried placing the control in the default directory of my app and then running regsvr32 msrdp.ocx. There were no complaints, but the form still didn't work.
>
>Thanks in advance,
>Mike
>
>There is no error returned but the control does not seem to work.
I have created just such an app using MSRDP.OCX The user starts up my VFP application locally and on clicking a button I open a RDP session and open another application that now runs on TS within that window. The user cannot run any other application in the TS session. Once they quit my app they are logged off.
Some code...
WITH ThisForm.bbRDP
IF .Connected = 0
.Server = "MyServerName"
.Object.UserName = "MyDomain\"+"MyUsername"
.AdvancedSettings2.ClearTextPassword = "MyPassword"
.SecuredSettings.FullScreen = .T.
.SecuredSettings.StartProgram = "MyappPath+MyApp"
.SecuredSettings.WorkDir = "MyWorkingDirectory"
.Visible = .T.
.ConnectingText = "Now connecting"
.DisconnectedText = "Your session has ended"
.Connect
ENDIF
ENDWITH
You can set the .Width and .Height if not full screen. This can be added to the OnConnected Event of the RDP object.
Check out the other events like the OnDisconnected which you can hook into.
Drop me a line if you need more help with this.