Desktop Cleanup Script

R29Matt
New Contributor II

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?

1 ACCEPTED SOLUTION

cddwyer
Contributor

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?

View solution in original post

2 REPLIES 2

cddwyer
Contributor

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?

R29Matt
New Contributor II

Yes, it does make sense.

Thanks!