Reputation: 83
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.
Upvotes: 0
Views: 2279
Reputation: 5545
Try this instead of shell:
Process.Start("C:\Windows\System32\mstsc.exe", RDPtext.Text)
You can continue to use shell if you want but you have to do something like this to get it to work:
Shell("C:\Windows\System32\mstsc.exe """ & RDPtext.Text & """", vbMaximizedFocus)
Upvotes: 1