Show All File Extensions for All Users

Mitch260488
New Contributor II

Hi All,

I'm trying to run the following command to turn on file extensions. This will work if I run this via terminal on the logged in users, but I can't make this work through user for the current logged in users.

defaults write GlobalPreferences AppleShowAllExtensions -bool true"

Any help would be great.

Thanks

Mitch

3 REPLIES 3

maiksanftenberg
Contributor II

Mitch you could set this via a Managed Preference in the JSS.
If you want to use a script it would be possible via /Users/username/Library/Preferences/.GlobalPreferences.plist
With a script you could gather the logged in user and then set the parameter from there.

gabester
Contributor III

Since Managed Preferences are done and over, is there any way to make this stick with Config Profiles in modern macOS?

ncats_lab
New Contributor III

You can do an Apple Script

tell application "Finder"
    activate
    set all name extensions showing of Finder preferences to true
end tell

The easy way to run this as the local user:

#!/bin/sh
sudo -u $3 osascript <<eos
tell application "Finder"
    activate
    set all name extensions showing of Finder preferences to true
end tell
eos