Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Renaming Files/File Extensions


22 Mar 2012   #1

Windows 7 Home Premium 64-bit
 
 
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 System SpecsSystem Spec
.

22 Mar 2012   #2

Windows 7 Ultimate x64 SP1
 
 

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 System SpecsSystem Spec
22 Mar 2012   #3
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

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 System SpecsSystem Spec
.


22 Mar 2012   #4

Windows 7 Home Premium 64-bit
 
 

Quote   Quote: Originally Posted by kegobeer View Post
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 System SpecsSystem Spec
22 Mar 2012   #5

Windows 7 Home Premium 64-bit
 
 

Quote   Quote: Originally Posted by Brink View Post
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 System SpecsSystem Spec
23 Mar 2012   #6

MS Windows 7 Ultimate 64-bit SP1
 
 

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
Renaming Files/File Extensions-bulk-rename-utility.jpg  
My System SpecsSystem Spec
23 Mar 2012   #7

XP / Win7 x64 Pro
 
 

[QUOTE=Coaxsist;1850217]
Quote   Quote: Originally Posted by kegobeer View Post
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 System SpecsSystem Spec
23 Mar 2012   #8

Windows 7 Home Premium 64-bit
 
 

Quote   Quote: Originally Posted by kegobeer View Post
Does that make sense?
Yea, it does. Thank you.
My System SpecsSystem Spec
23 Mar 2012   #9

Windows 7 Home Premium 64-bit
 
 

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 System SpecsSystem Spec
Reply

 Renaming Files/File Extensions




Thread Tools



Similar help and support threads for2: Renaming Files/File Extensions
Thread Forum
Show File Extensions and Hidden Files for all Users General Discussion
Solved Renaming multiple file extensions at once General Discussion
Solved Need to see file extensions General Discussion
renaming files - file name too large? how to disable this? General Discussion
File Extensions General Discussion
Governing files & Can UAC Block/Warn Before File Moving/Renaming? Customization
file extensions General Discussion

Our Sites

Site Links

About Us

Find 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 11:22 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33