Question

This is probably a simple fix or totally impossible......not entirely sure....

I have a database stored remotely and my program accesses it. It has a list of properties that we do remote support for. There is a folder full of RDP's as well. When I use the code below it works BUT when I switch the path to a variable it does not. I tried converting to different things and it still say the path does not exist.

I tried calling the variable to display in a messagebox to verify the data in the string is correct and it is.

THIS WORKS Shell("C:\Windows\System32\mstsc.exe P:\Server\program\Server.RDP", vbMaximizedFocus)

THIS DOES NOT BUT THIS IS WHAT I NEED

Shell("C:\Windows\System32\mstsc.exe" & RDPtext.Text, vbMaximizedFocus)

RDPText.text is a label that is displaying info from the database. That info is the file path. I tried creating a variable and passing the string to the variable with no luck either.

Thanks in advance!

Was it helpful?

Solution

In the second example you didn't add the required space betweeen the exe and its argument

 Shell("C:\Windows\System32\mstsc.exe " & RDPtext.Text, vbMaximizedFocus)
                                     ^
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top