macOS Finder – File Extension Not Hiding

dmgfile extensionsfindermacos

I have a .dmg file and I want to hide its extension. So I do the usual and ⌘I, then check Hide extension. killall Finder just to be sure. I look and sure enough… the file extension is still there. So I use SetFile -a E myfile.dmg hoping that will work. It doesn't. Any ideas? Here's a picture just in case.enter image description here

Best Answer

OK, I found the issue. Apparently two options have to be set in order for any extension to disappear (except for .app). First you have to go into Finder's Preferences > Advanced. Untick Show all filename extensions. Then you tick Hide extension in the Get Info window for your file and the extension is hidden.