I want to do exactly the same as in this question:
Windows file system is case insensitive. How, given a file/folder name (e.g. \"somefile\"), I get t
It looks like the best way is to iterate through all folders in the path and get their proper caps:
Public Function gfnProperPath(ByVal sPath As String) As String
If Not IO.File.Exists(sPath) AndAlso Not IO.Directory.Exists(sPath) Then Return sPath
Dim sarSplitPath() As String = sPath.Split("\")
Dim sAddPath As String = sarSplitPath(0).ToUpper & "\"
For i = 1 To sarSplitPath.Length - 1
sPath = sAddPath & "\" & sarSplitPath(i)
If IO.File.Exists(sPath) Then
Return IO.Directory.GetFiles(sAddPath, sarSplitPath(i), IO.SearchOption.TopDirectoryOnly)(0)
ElseIf IO.Directory.Exists(sPath) Then
sAddPath = IO.Directory.GetDirectories(sAddPath, sarSplitPath(i), IO.SearchOption.TopDirectoryOnly)(0)
End If
Next
Return sPath
End Function