self deleting startupitems

Bukira
Contributor

Hi People,

Im trying to write some startupitems that well delete themselves after they have run, Casper's FirstRun script uses the following command

/bin/rm -rf 'path to folder'

i have tried this and it doesnt delete itself

Criss Criss Myers
Senior Customer Support Analyst (Mac Services)
Apple Certified Technical Coordinator v10.5
LIS Business Support Team
Library 301
University of Central Lancashire
Preston PR1 2HE
Ex 5054
01772 895054

3 REPLIES 3

kalikkalik
New Contributor

I found some oddities with casper here, and since we use laptops and are not always downloading new policies, I created a launchd item and a script...the launchd item loads on boot and executes the script - the last two thing the script does is to securely delete the launchditem, and then the script itself...reboots if needed.

-j

milesleacy
Valued Contributor

Why not use a "once per computer" or "once per user" policy?

----------
Miles A. Leacy IV

? Certified System Administrator
? Certified Trainer
Certified Casper Administrator
----------
voice: 1-347-277-7321
miles.leacy at themacadmin.com
www.themacadmin.com

ernstcs
Contributor III

I have a few things that do this at startup without issue. I also utilize one of the features of the JAMF binary to make sure the network is up and the JSS is available before attempting the command. I had some Recon issues so I made a startup item recon that deletes itself after it's run.

Not sure if the list will pass the DMG, but if it doesn't let me know.

Craig E