Possible Duplicate:
Renaming Directory with same name different case
I appear to be running into a rather strange issue. I am using Directory.Move(oldDir, newDir) to attempt to rename a series of folders. The issue I seem to be running into is that some of the directories I am renaming are merely just renaming them to the same name only with different cases.
For instance, I have a directory named ‘UL17’ and I would prefer that all my directories be named in lowercase. So, I have written a routine that will perform the transformation to lowercase, except when I attempt to run the old directory and the new one through the Directory.Move function, it throws an error saying that the new directory must be different from the old one. I am getting pretty frustrated with this because renaming a directory is not supposed to be rocket science.
I’m finding that good old Microsoft as, yet again, managed to take something so tremendously simple and convoluted it into something absolutely ridiculous.
This will be because you are naming the directory the same name. The case won’t matter. What I’d suggest is to rename the directory to, for example from Dir to Dir1, then to dir.