1

When I tried to rename a file(the extension was some random text, Windows Disk Check caused it) in Windows Explorer, it told me that there's another file with the same name in the same location, as in the image below,
enter image description here
And the prompt windows made me is as follows,
enter image description here
It is clear from the images that the file Windows mentions about having the same name doesn't have the same name as the file being renamed.
What's happening here? This usually happens after I run a Check Disk on a removable drive, windows messes up the file names and their extensions.
What is happening here?
Why does windows change my file names and their extensions?
How can I restore the original file name?

RogUE
  • 3,481
  • 9
  • 34
  • 56
  • I'm confused here. You're renaming `IMG_20~1.JP0` to `IMG_20170215_104017902.jpg`, right? But `IMG_20170215_104017902.jpg` does indeed already exist in that folder, it's the third file down... Can you clarify what exactly it is you're doing and why the result is unexpected, maybe? – realityChemist Feb 17 '17 at 16:16
  • @realityChemist I simply am correcting the extension, not the file name. That is, I am renaming the file to **IMG_20~1.jpg** from **IMG_20~1.JP0**. – RogUE Feb 17 '17 at 16:18
  • Oh, I see now, I didn't notice you'd changed the file extension there. That is indeed very strange behavior! Unfortunately I'm not very well versed in Windows, but hopefully someone can! – realityChemist Feb 17 '17 at 16:27
  • 1
    I have had this problem before. Take a look at [This](https://superuser.com/questions/211355/what-does-the-mean-in-a-file-path) other SuperUser question. The problem seems to be the inclusion of the `~` key in your filename. – MrPublic Feb 17 '17 at 16:27
  • If you don't mind me asking, how often to you run CHKDSK on a removable drive? If everything is working properly, that should only be done on rare occasions. Beyond that, in your first picture the third file on the list has the specific file name that you are trying to use, so it appears that it *does* already exist in that location. – Run5k Feb 17 '17 at 16:41
  • @Run5k I use CHKDSK often because Windows prompts me to do so. I simply am correcting the extension, not the file name. That is, I am renaming the file to IMG_20~1.jpg from IMG_20~1.JP0. You can see it in the second image, where the extension of the first file has been changed from **.JP0** to **.jpg**. – RogUE Feb 18 '17 at 02:04
  • I believe that I have solved the mystery behind this problem. Please see my answer below. – Run5k Feb 18 '17 at 03:27
  • It has been several days since we heard from you. Did you have any lingering questions? – Run5k Feb 22 '17 at 02:12

1 Answers1

1

Ultimately, I think that this is a simple misunderstanding in terminology. The file names that you see similar to IMG_20~1.JP0 are in the legacy 8.3 format utilized for backwards compatibility purposes:

Windows truncates the file name, if necessary, to six characters and appends a tilde (~) and a digit. For example, each unique file name created ends with "~1." Duplicate file names end with "~2," "~3," and so on.

(Source: How Windows Generates 8.3 File Names from Long File Names)

In other words, every file name potentially has an 8.3 format equivalent. You can display all of them within any given folder by navigating there in a command prompt window and executing the dir /x command. However, although you wouldn't see it within that particular view, the files still maintain their longer (or modern) file names behind the scenes.

Your external drive may have some type of disk integrity problem that is causing the operating system to ask you to run CHKDSK so often. Essentially, during the CHKDSK process it is encountering problems that are creating full and/or partial duplicates of some of your files, displaying them in the legacy 8.3 format, and changing the file type from JPG to JP0, JP1, etc., to avoid conflict with the original file. But remember that "behind the scenes," the file you see with an 8.3 file name (such as IMG_20~1.JP0) still has a longer file name. This is revealed when you attempt to change the file type from JP0 to JPG: the legacy 8.3 file has an unseen full-length file name identical to your original JPG file, so when you try to change it to a JPG extension it tells you that file name already exists.

The bottom line is as follows: you are seeing two different visual representations of the same file name, one shown in the legacy 8.3 format, while the other is displayed in the modern long file name format. They can coexist within the same folder because they have different file extensions, but when you try to change that legacy file's extension to match that of the longer file name, the operating system correctly tells you that it already exists.

The root cause of this problem appears to be your external hard drive. The drive's file system has some issues, or the hardware has problems… perhaps even both. But hopefully I have helped clear up the mystery behind "There is already a file with the same name in this location."

Run5k
  • 15,723
  • 24
  • 49
  • 63
  • Is there any way to restore the original, non-truncated file name? – RogUE Feb 18 '17 at 11:58
  • As I said earlier, it appears that *"during the CHKDSK process it is encountering problems that are creating full and/or partial duplicates of some of your files."* You would need to confirm it personally, but it looks like the file (along with the non-truncated name) already exists. If it works properly (opening in an image viewer, etc.), you should be able to safely delete the 8.3 format duplicates. – Run5k Feb 18 '17 at 12:46
  • Though they have the same name, they are different image files, so I cannot delete any of it. – RogUE Feb 22 '17 at 04:02