Skip to main content
Question

Removing desktop icons

  • February 8, 2013
  • 3 replies
  • 6 views

Forum|alt.badge.img+7

Ok, so I made a classic mistake and selected a Smart Computer Group to send a policy, but didn't check the box next to Assign to Selected Computers and instead sent my policy to all Computers.

This isn't a huge deal because I was able to send out a policy to uninstall before much damage was done. But the installation was two AppleScript Applications that loaded onto the desktop. When I ran the uninstall as a policy (by indexing the package and then running a policy to uninstall the .dmg) it successfully uninstalled the applications but left an icon on the desktop that looks like the application symbol covered up by a prohibitory sign.

I could send out a command to move these to the trash (mv /Users/specificuser/desktop/file ~/.Trash/), but the problem is that I installed the package with FEU and FUT checked and the command would only remove them from a specific user. Any ideas would be greatly appreciated.

3 replies

Forum|alt.badge.img+13
  • Honored Contributor
  • 550 replies
  • February 9, 2013

you could write a do loop excluding adminShared accounts to remove the item from users desktop

LS


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • 1913 replies
  • February 9, 2013

I believe you can use a wildcard character to remove from all User home folders and then add a second command separated by a semi-colon to remove from the User Template:

rm -R /Users/*/Desktop/file ; rm -R /System/Library/User Template/English.lproj/Desktop/file

Forum|alt.badge.img
  • New Contributor
  • 1 reply
  • March 20, 2019

I couldn't get rm to work for some reason but this worked, perhaps I have the extension (webloc for a browser shortcut) wrong?:

sudo find /users/*/desktop/ -name 'filenamewithoutextension' -delete