Hi
Although there may be other considerations, here is an example to remove invalid characters from a Directory name. There are many other entities that use some sort of Path/naming conventions, but for standard Directory names, this may be OK. If you would rather replace the invalid characters with your own choice, then just replace the 'String.Empty' with the character you want to use.
Dim fixed1 As String = Fix("Fujitsu // American MegaTrends")
Dim fixed2 As String = Fix("System x3650 M5: -[8871AC1]-")
Function Fix(s As String) As String
Dim NotAllowed As String = """\/:|<>*?."
Dim cc As New List(Of Char)
For i As Integer = 1 To 31
NotAllowed &= Chr(i)
Next
For Each ch As Char In NotAllowed
s = s.Replace(ch, String.Empty)
Next
Return Trim(s)
End Function