Icons remains the same after I have changed the default program for opening the file

Solution 1:

You can try to rebuild LaunchServices database from Terminal:

/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

Path to lsregister on Mavericks is:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister

Solution 2:

For Yosemite 10.10.4 use:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

Solution 3:

On macOS Sierra 10.12.1 the lsregister solution provided by @Mateusz Szlosek hasn't worked.

But this solution worked: Reset icon cache on MacBook

Nevertheless, changing the default application for a file type via Finder's "Open with…" causes no immediate refresh of icons on the Desktop and in the Finder windows. This is a bug.


Some criticism at the end: As a long time Apple user I always preferred the instant feedback and GUI refresh of macOS as opposed to Windows, where you had and still have to do a lot of manual refreshing & more burdens/precaution for the user due to a lack of cross process sync/awareness (i.e. renaming a file in Explorer while it is open in another app, will cause you problems, still in 2016).

Instant cross process interaction of all stock apps and all apps using standard frameworks is what's so fine on the Mac, i.e. Re-enabling a network interface and Safari automatically loads the content of an idle browser tab, Renaming a file in Finder while it was opened hassle free, Changing an icon and its updated in every view instance (Finder, file dialog of apps, icon in app's title bar), etc.

Hate to see these qualities vanishing. Apple clearly neglects its professional Mac users over its iOS users and their Cloud services. With iCloud Apple perfects cross device sync but does not deliver the perfect synchronism within the Mac as it once did.