Question

I think i need to escape the special chars here:

Process.Start(userSelectedFilePath, "\u0007" & ThisDir.Path & "\u000B" & checkedpath1 & "\u0007")

The result need to be like: userselecfilepath "a blackquoted path\and other folder"

what i'm doing wrong?

thankyou

UPDATE

Solution:

ControlChars.Quote & Path.Combine(ThisDir.Path, checkedpath1) & ControlChars.Quote
Was it helpful?

Solution

Process.Start(userSelectedFilePath, Path.Combine(ThisDir.Path, checkedpath));

Path.Combine

If path1 is not a drive reference (that is, "C:" or "D:") and does not end with a valid separator character as defined in DirectorySeparatorChar, AltDirectorySeparatorChar, or VolumeSeparatorChar, DirectorySeparatorChar is appended to path1 before concatenation.

If path2 does not include a root (for example, if path2 does not start with a separator character or a drive specification), the result is a concatenation of the two paths, with an intervening separator character. If path2 includes a root, path2 is returned.

The parameters are not parsed if they have white space. Therefore, if path2 includes white space (for example, " c:\ "), the Combine method appends path2 to path1 instead of returning only path2.

Not all invalid characters for directory and file names are interpreted as unacceptable by the Combine method, because you can use these characters for search wildcard characters. For example, while Path.Combine("c:\", "*.txt") might be invalid if you were to create a file from it, it is valid as a search string. It is therefore successfully interpreted by the Combine method.

OTHER TIPS

try this:

Process.Start(userSelectedFilePath, "\\" & ThisDir.Path & "\\" & checkedpath1 & "\\")

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top