Directory Rename
-
Hi All, I have a very simple problem .I want to rename a directory using C#.But I am not changing the location of directory neither its name(letters) just the case(from upper to lower or vice a versa).now if i use Directory.Move or MoveTo method of directoryinfo class i get the exception that source and destination must be different.one way around this problem is that i should use move or moveto twice first moving this directory to somewhere else then moving it again with the name having different case.but i don't want to do that.Can somebody tell me how to do this.Thanks in Advance. Rakesh
-
Hi All, I have a very simple problem .I want to rename a directory using C#.But I am not changing the location of directory neither its name(letters) just the case(from upper to lower or vice a versa).now if i use Directory.Move or MoveTo method of directoryinfo class i get the exception that source and destination must be different.one way around this problem is that i should use move or moveto twice first moving this directory to somewhere else then moving it again with the name having different case.but i don't want to do that.Can somebody tell me how to do this.Thanks in Advance. Rakesh
-
Hi shafqaat, You didn't get it.if my directory is C:\My Documents\pictures i want to Change it to C:\My Documents\PIctures .I mean i just want to change the case of some letters in the name of the directory.not its location.any suggestions.Thanks in Advance. Rakesh
-
Hi shafqaat, You didn't get it.if my directory is C:\My Documents\pictures i want to Change it to C:\My Documents\PIctures .I mean i just want to change the case of some letters in the name of the directory.not its location.any suggestions.Thanks in Advance. Rakesh
Since Windows has a case-insensitive view of the file system, "C:\My Documents\Pictures" and "C:\My Documents\pictures" is the same. You cannot change the case only. Try renaming it to "C:\My Documents\pictures.tmp" and then back to "C:\My Documents\Pictures". "we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty
-
Hi shafqaat, You didn't get it.if my directory is C:\My Documents\pictures i want to Change it to C:\My Documents\PIctures .I mean i just want to change the case of some letters in the name of the directory.not its location.any suggestions.Thanks in Advance. Rakesh
Create a Directory Pictures(not on the same location of pictures).And move Contents of pictures to Pictures. Delete pictures Move Pictures to the location of pictures. For optimization the best way is to create Pictures on same drive (the one have pictures) in any other dummy directory and than delete pictures and than move Pictures to location of pictures. Like c:\\MyDummy\\Pictures
-
Since Windows has a case-insensitive view of the file system, "C:\My Documents\Pictures" and "C:\My Documents\pictures" is the same. You cannot change the case only. Try renaming it to "C:\My Documents\pictures.tmp" and then back to "C:\My Documents\Pictures". "we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty
Thanks for your reply.I know windows is case insensitive.In files case the case can be changed using MoveTo method of filesysteminfo class.it changes the case .is there any equivalent for directory may be any api or anything.thanks again. Rakesh