问题
does anybody have idea why some windows XP installation would not evaluate path with double backslash in them?
Error is found on some XP (same build, patches, unknown more details). In most everything works, on some PCs following doesn't work:
Querying path (registry or folder) with functions like RegEnumKeyEx, fopen fails if path contains two backslashes, for example C:\\test\hello.txt
.
strPath = "\SOFTWARE\Microsoft\Windows\Currentversion\run" // works
strPath = "\SOFTWARE\Microsoft\Windows\Currentversion\\run" // doesn't work
Is there some policy option or setting which can affect it?
Any help welcome, RM
回答1:
Why don't you simply modify the path to only have a single \ before using it?
回答2:
Possibly completely unrelated, but in C/C++ (and other languages too) -
"c:\\\\test\hello.txt"
is okay, but "c:\test\hello.txt"
is not (because \t
is parsed as a tab character, so you get a name that doesn't really exist).
Is there a chance the failure happens when the two backslashes don't exist, and things work when they do?
来源:https://stackoverflow.com/questions/729151/double-backslash-not-work