USING Call Shell to open Remote Desktop by clicking on a server name in a form

11 views
Skip to first unread message

Robert Bollinger

unread,
Dec 8, 2015, 10:59:03 AM12/8/15
to
Has anyone figured this out: How to open Remote Desktop (that's C:\Windows\System32\mstsc.exe") by clicking on the onclick event of a form. And the server that you clicked on is populated and prompting you for the password.

My form consists of a list of servers. What I want to do is click on a server and Microsoft Remote Desktop is prepopulated with that server name.

Here is what I have working now:

When you click the server (in a continuous forms setup) it just brings up the Remote Desktop App with the last server that was accessed. That's using this syntax in an 0nclick event:

stAppName = "C:\Windows\System32\mstsc.exe"
Call Shell(stAppName, 1)


To do this form the RUN command prompt, this is the syntax:
"C:\Windows\System32\mstsc.exe" /V:MYServer

What I "Imagine" the syntax is close to is:

spAppName = "C:\Windows\System32\mstsc.exe"
Call Shell(stAppName, 1) & "/V:" & Me.ServerName

I know that doesn't work because I tried several variations of that. But I think it demonstrates exactly what I am trying to accomplish.

Thank you in advance!

RBollinger
Reply all
Reply to author
Forward
0 new messages