Renaming Files/File Extensions


  1. Posts : 15
    Windows 7 Home Premium 64-bit
       #1

    Renaming Files/File Extensions


    Setup: Win 7 Home Premium SP 1 x64 on Dell Studio 1558.

    In most directories, if I rename "file.jpg" to... "file.JPG" and hit return to commit the change, "file.jpg" is the result.

    When I go to rename "file.jpg" again and the text is highlighted, awaiting my input, "file.jpg" turns into... "file.JPG", as I had originally renamed it.

    If I rename "file.jpg" to... "file1.JPG", the change commits. I can then rename "file1.JPG" to... "file.JPG" without any problem.

    Does anyone have any idea why this might be happening? And what's the difference between upper and lowercase extensions anyways?
      My Computer


  2. Posts : 2,913
    Windows 7 Ultimate x64 SP1
       #2

    In Windows, an extension is the same regardless of uppercase or lowercase. However, if you move this file to a Linux file system, JPG is not the same as jpg. *nix operating system files are case sensitive.
      My Computer


  3. Posts : 72,041
    64-bit Windows 11 Pro for Workstations
       #3

    Hello Coaxsist,

    Yep, due to Windows 7 seeing uppercase and lowercase file extensions the same, you'll need to rename it to something else say .jph, then rename it again to .jpg.

    Personally, I wouldn't worry about it since it doesn't matter to Windows unless you just wanted it back to lowercase though.
      My Computer


  4. Posts : 15
    Windows 7 Home Premium 64-bit
    Thread Starter
       #4

    kegobeer said:
    In Windows, an extension is the same regardless of uppercase or lowercase. However, if you move this file to a Linux file system, JPG is not the same as jpg. *nix operating system files are case sensitive.
    Okay kegobeer, can you answer me this then?

    I have an html tag
    Code:
    <img src="img/file.jpg" />
    and 1 image file, "file.JPG".
    The code above does not display the image; it's not found/doesn't exist. If the code is changed to accommodate the uppercase extension though, the image is then displayed.

    Now that I think about it, some of my hosting accounts are based on *nix servers... so your earlier explanation could be it.

    However, even if extensions are not case sensitive in Windows, why does my original question even happen?
      My Computer


  5. Posts : 15
    Windows 7 Home Premium 64-bit
    Thread Starter
       #5

    Brink said:
    Personally, I wouldn't worry about it since it doesn't matter to Windows unless you just wanted it back to lowercase though.
    That's the thing. I get files with uppercase extensions often from clients (web design/development) and this issue gets in the way often. Do you know anymore about it, or have you just accepted it and moved on? I'd like to know if there's a fix of some sort; like forcing all extensions in Windows to be lowercase.
      My Computer


  6. Posts : 742
    MS Windows 7 Ultimate 64-bit SP1
       #6

    Bulk Rename Utility is one of the free file rename utility programs I like and it can easily convert the upper and mixed case extensions to lower, upper, Title cases etc. for multiple files and folders.
    Attached Thumbnails Attached Thumbnails Renaming Files/File Extensions-bulk-rename-utility.jpg  
      My Computer


  7. Posts : 1,814
    XP / Win7 x64 Pro
       #7

    [QUOTE=Coaxsist;1850217]
    kegobeer said:
    However, even if extensions are not case sensitive in Windows, why does my original question even happen?
    The easiest way to explain it is the following...

    As stated, Windows doesn't care what case the extension is in, so JPG == jpg == JpG, etc. So, if you are starting with a file called temp.jpg and change it to temp.JPG, according to Windows, there is no change in the properties of the file. For all intents and purposes, temp.jpg is the same name as temp.JPG, so there is nothing for Windows to change regarding the file. However, if you rename temp.jpg to temp1.jpg, that is a definitely different file name since the name and case of the file name matters, according to Windows, so it will update the record accordingly. Does that make sense?
      My Computer


  8. Posts : 15
    Windows 7 Home Premium 64-bit
    Thread Starter
       #8

    kegobeer said:
    Does that make sense?
    Yea, it does. Thank you.
      My Computer


  9. Posts : 15
    Windows 7 Home Premium 64-bit
    Thread Starter
       #9

    So to recap for everyone else:

    • Windows doesn't care if your extension is upper or lowercase. .jpg == .JPG
      • Therefore, if "file.jpg" were renamed "file.JPG" according to Windows, there is no change in the properties of the file. For all intents and purposes, temp.jpg is the same name as temp.JPG, so there is nothing for Windows to change regarding the file.
        • This means if "file.jpg" were a black square and "file.JPG" was a white square, and you overwrote "file.jpg" with "file.JPG" the black square would still be the only image, not white. To Windows, it's the same file.
      • However, if you rename "file.jpg" to "file1.jpg", that is a definitely different file name since the name and case of the file name matters, according to Windows, so it will update the record accordingly.


    So...

    • Any operating system ending in "nix" knows that "file.jpg" and "file.JPG" are different files.
      • This means that if you have an image tag with a src of "file.jpg" and you uploaded "file.JPG" and the server you've uploaded to is running anything "nix" (or Linux) your image will not display.
      • The code that doesn't work on your server running anything "nix" or Linux will work however on Windows because Windows doesn't know/doesn't care about the difference between lowercase and uppercase extensions.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:57.
Find Us