Friday 27 September 2013

Invalid Connection File on RDP launch from VB app (some work, some don't)

Invalid Connection File on RDP launch from VB app (some work, some don't)

I have a a VB Express 2010 application that allows users to select a Hotel
we manage from a database. This is an access database. It then displays
the all of the info for the hotel. Everything works well. Except! the link
to the RDP. All of the RDP's are stored in a public root folder on our
shared network drive. The file path for each is Column in the database. I
put a label in to test that the correct filepath was being pulled. Then I
hid the label and use its text property to call the RDP session. Most
connections just launch the RDP but some say "INVALID CONNECTION FILE
(lastpart of name.RDP) Specified."
Here's a bit of code:
RDPtext is a label that shows (when not hidden) the file path pulled from
the database
If RDPtext.Text = "" Then MessageBox.Show("This Property Uses A Different
Connection Method" & vbCrLf & "Check SHAREPOINT DOCUMENTATION for more
info.", "Site Does Not Use RDP") Else Shell("C:\Windows\System32\mstsc.exe
" & RDPtext.Text, vbMaximizedFocus)
End If
The filepath is all the same folder just different RDPs. The path may be
S:\shared\MyProgram\RDPs\NAMEofRDP.RDP
again some work and some cast an error.
Thanks in advance!
-Dave

No comments:

Post a Comment