Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've been unable to concatenate the name of the executable file to the returned "AppPath" value from the registry.

I can successfully do so with one application that has the returned value "C:\Program Files (x86)\AppOne\"
but another application returns the value "C:\Program Files (x86)\AppTwo\..."
with three trailing dots and I can't concatenate anything to this.

What I have tried:

Trimming the string with
mystring=mystring.Trim(Chr(46))
but that doesn't work.
Posted
Updated 27-Feb-16 23:50pm
Comments
Kenneth Haugland 28-Feb-16 1:41am    
Did you try something like this:
https://msdn.microsoft.com/en-us/library/system.io.directory.getparent(v=vs.110).aspx

You should be able to stop at the correct path then. Or you could simply use ToString.Split("\") and stitch the path you want to find with Path.Combine
Richard MacCutchan 28-Feb-16 3:28am    
You need to talk to the owners of the application that returns the incomplete path.
Paul Bayley 28-Feb-16 4:39am    
It transpires that the three trailing dots in the registry value indicate that the string is longer than what is displayed, in this case the string has 209 extra white space characters.
Now I know that, I have been able to concatenate the name of the executable file to the path.
Thanks for your input.
Patrice T 28-Feb-16 5:01am    
If the question is solved, close the question.

1 solution

Just to remove from unanswered questions, OP found a solution:
Quote:
It transpires that the three trailing dots in the registry value indicate that the string is longer than what is displayed, in this case the string has 209 extra white space characters.
Now I know that, I have been able to concatenate the name of the executable file to the path.
Thanks for your input.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900