Quote Originally Posted by anmac1789 View Post
I am confused about this line of code:

Private Function RemovePrefix(s As String) As String
    RemovePrefix = IIf(Left(s, 4) = "\\?\", Right(s, Len(s) - 4), s)
End Function
The long path names is something I couldn't / didn't test, but the function takes a string and if it begins with "\\?" remove those characters and returns what's left, otherwise it just returns the input string

Instead of using the IIF() function, If / Then / Else / EndIf would have worked

https://docs.microsoft.com/en-us/off...6)%26rd%3Dtrue

IIf(expr, truepart, falsepart)

The IIf function syntax has these named arguments:
Part Description
expr Required. Expression that you want to evaluate.
truepart Required. Value or expression returned if expr is True.
falsepart Required. Value or expression returned if expr is False.