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
Coaxsist

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
kegobeer

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
Brink
Microsoft MVP

64-bit Windows 10
 
 

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
Coaxsist

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
Coaxsist

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
rraod

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
-bulk-rename-utility.jpg  
My System SpecsSystem Spec
23 Mar 2012   #7
FliGi7

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
Coaxsist

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
Coaxsist

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
Thread Forum
File Extensions changed (doc/pdf/jpg/txt) *.*original file-ex*.cpjevac
I have a User that brought a computer to me. Mostly all the files within the user folders where changed. Example of a file. Should be (Birthday.jpg) is now (Birthday.jpg.cpjevac) I have deleted the extension .cpjevac from the name allowing it to change to .jpg file and when doing so the file...
Hardware & Devices
Batch file renaming files but not double
Hello, Got another batch file question. I think I`m close but I`m overlooking something. I have some logging that will get the date of today when I log off. But now if I log off twice the file won`t rename, filename already exists. So I came with a script to just add a number behind the...
Performance & Maintenance
Show File Extensions and Hidden Files for all Users
Hi, I am trying to change the registry to show hidden files/extensions. This is for an unattended install, so I don't want to do it manually for each user. I know I can change the registry for the current user, but I can't seem to find out how to do this system wide. I need to show hidden files...
General Discussion
Renaming multiple file extensions at once
How do i change multiple file extensions name all at once? I have all MKV file and would like to change it in to AVI. This process is taking far too long. Is there a shortcut to this? other than renaming each individual file. Thankyou
General Discussion
renaming files - file name too large? how to disable this?
So I'm renaming some songs but when I do this I get this message: http://i44.tinypic.com/15etpgh.png But my filename is not that long! Here is how long I can make it before my keyboard does not enter characters. They just don't show up when I type. ...
General Discussion
Governing files & Can UAC Block/Warn Before File Moving/Renaming?
You know how UAC (user account Control) asks for permission when executing certain programs or when renaming or modding certain files in certain directories? Well i wish i could have it govern over many other folders and files because i tend to accidentally move my hand when double-clicking...
Customization

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 14:51.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App