That's because \ is the escape character. For example, \n will print a new line. \t is a tab I believe.
Writing \\ should work, I'm not sure why it wouldn't. If you're specifying directories, / should work just fine though. I know windows doesnt care, not sure about *nix