The item “.VolumeIcon.icns” can’t be replaced because it’s invisible

Solution 1:

I have gotten this error when trying to delete or affect an invisible file before. Temporarily turning the file visible usually, in my experience, changes the error to a dialog that asks if you are sure you would like to change the file. I figure you have probably already come across this command, but for completeness, here is the explanation:

To make invisible files visible, enter this code in terminal:

defaults write com.apple.finder AppleShowAllFiles TRUE && killall Finder

and to make invisible files invisible again:

defaults write com.apple.finder AppleShowAllFiles FALSE && killall Finder

Note that this does close finder, so make sure you don't have any important folders open. I believe that it opens previously opened windows, but the back button doesn't work in my experience.

What's happening

defaults

This is OSX's command to change defaults, apple's low-level preference system.

write

This tells defaults you want to change a preference, or write it

com.apple.finder

This tells defaults that the application's preferences you want to change is Finder, specified by the application's bundle identifier.

AppleShowAllFiles

This specifies which preference you want to change within the application.

TRUE or FALSE

This is the value you want to set the preference to. In this case, it is a boolean, so the values must be TRUE or FALSE. I think you might be able to use YES or NO, but I'm not sure.

&&

This is a terminal operator to run whatever's after this if the previous command is successful

killall

I don't know much about this, but it kills processes or closes applications

Finder

Specifies which process or application to close.