Skip to main content
Solved

Desktop Cleanup Script

  • September 4, 2017
  • 2 replies
  • 8 views

Forum|alt.badge.img+3

I have seen some variations on this but am yet to find one that meets my needs fully.

We have a problem with users desktops becoming the personal dumping ground for anything and everything. Ideally, I would like to be able to run a script that puts all the files on their desktop, ignoring web links (we have some support links on there we need them to keep) into a folder the script creates on their desktop.

Is it possible?

Best answer by cddwyer

You could try and gather a list of files and except all of the ones you've created using grep -v but that would be a bit messy. If it's only web links that you're deploying to the desktop I would zip them up and deploy the zip file to /Users/Shared or /var/ then have your script to do:

mv /Users/Joe.bloggs/Desktop/* /Some/other/folder

Then have your script unzip the web links back on to the desktops again.

Does that make sense?

2 replies

Forum|alt.badge.img+7
  • Contributor
  • Answer
  • September 4, 2017

You could try and gather a list of files and except all of the ones you've created using grep -v but that would be a bit messy. If it's only web links that you're deploying to the desktop I would zip them up and deploy the zip file to /Users/Shared or /var/ then have your script to do:

mv /Users/Joe.bloggs/Desktop/* /Some/other/folder

Then have your script unzip the web links back on to the desktops again.

Does that make sense?


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • September 4, 2017

Yes, it does make sense.

Thanks!