VBA remote desktop connection mstscax


D

djw

I would like to setup a remote desktop connection using vba on a
client machine from which I would need to execute a few command such
as opening a program etc. on the server.

I have some limited VBA experience but I have no Idea on how to get
this to work correctly

I referenced in the mstscax.dll and can see that the MSTSCLib object
has a server and connect method. If I do something such as

Dim X As MsRdpClient
Set X = New MsRdpClient
X.Server = ip_address
X.Connect

Nothing happens. Also, how would I start a program once connected,
could I use the OnConnected event? Is there anyway to send a file to
the remote system, or send a paste command to the opened program?

Is there anyway to get SendKeys to work with Remote Desktop Session?

Thanks,
David
 
Ad

Advertisements

D

djw

After learning a bit of C# and implementing it in that, I realized all
I needed to do was to create a form in Access and add the "Microsoft
RDP Client Control (redist)" to the form. After it is on the form you
can get at the properties and execute the connect procedure. I guess
you cannot just create a MsRdpClient in VBA without it residing on a
form.

Now is there anyway to interact with programs running within the RDP
ActiveX box? I know I can start a program and pass a command line
procedure to the program. Is this the limit on interacting with the
programs in the RDP environment? Is there some way to pass values
back and forth?

Thanks,
David
 
Ad

Advertisements

D

djw

It looks like to send info to the server I would need to
CreateVirtualChannels(ChannelName) and then use SendOnVirtualChannel
(ChannelName, DataToSend).

However, I cannot figure out how to receive this data on the server.
It seems like a C# program might be required. Is there some way to do
this in VBA, by including the wtsapi32.dll such as the following:

Private Declare Function WTSVirtualChannelOpen Lib "wtsapi32" (hServer
As String, ByVal sessionid As Integer, chan_name As String) ???

This is way beyond my VBA capabilities . . .
 

Similar threads

M
Replies
1
Views
171
Hesselberg
H
T
Replies
2
Views
230
David W. Fenton
D
R
Replies
1
Views
206
david epsom dot com dot au
D
C
Replies
4
Views
301
Mary Sauer
M
B
Replies
4
Views
488
Brad
B
P
Replies
0
Views
161
pgarcia
P
B
Replies
6
Views
267
Paul Shapiro
P
A
Replies
0
Views
180
Alex219267 via AccessMonster.com
A
Top