Skip to main content
Question

Policy to delete a folder in the Applications Folder

  • October 2, 2013
  • 2 replies
  • 10 views

jaymckay
Forum|alt.badge.img+4

Hi All,

I'm trying to create a policy that will remove a folder that was originally deployed to a number of computers via policy. The name of the folder is "Logger Pro 3". I've tried to create a policy with the command line "find /Applications -name "Logger Pro 3" -maxdepth 1 -delete" with no luck.

I'm sure it's pretty straight forward, but any help would be greatly appreciated.

Thanks!

Jay

2 replies

Forum|alt.badge.img+18
  • Contributor
  • October 2, 2013

Since you know where it is, you don't need to find it. Maybe this:

if [ -d "/Applications/Logger Pro 3" ]; then rm -R "/Applications/Logger Pro 3"; fi

Can't recall if you need to escape those spaces in the path, sorry.


mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • October 2, 2013

You could make it even simpler, assuming you know that that's the path to the application.

rm -Rfd "/Applications/Logger Pro 3" 2> /dev/null

If its not there it will do nothing. If it is there, it will delete it.