I agree with that. I mean C:\\temp is an invalid path under Windows. It would be better to fix the thing that generates this invalid path rather than trying to hack that path into a valid path. The crux of an X-Y problem is that the OP is asking the wrong question or that the question is not well specified.