Self Destructing script

I've created a very simple AppleScript that I would like to auto launch at login, and then self delete.

Any suggestions on how to get this to launch at login?
And then to self delete, should I use a 'do shell script' command at the end that does an 'rm' on the script?

thanks,
Darrin

Mac OS X (10.5.7)

Posted on Jun 18, 2009 9:44 AM

Reply
9 replies

Jun 19, 2009 1:51 AM in response to DPert

What on earth are you trying to accomplish?

In what you have asked in Unix and AppleScript fora, I can see you have been trying to -

• delete all user's login keychains remotely via ARD
• create new admin user and enable ARD via shell
• add some user under key 'HiddenUsersList' in com.apple.loginwindow.plist

... now you're asking for a way to run a script at user's login and then self-delete it so that it won't leave any trace?

As a whole, it could do very malicious things to innocent users.

With all due respect, I would not help such possibilities.
H

Jun 19, 2009 8:35 AM in response to Hiroto

Well done Hiroto! Pat yourself on the back! You have successfully over analyzed a simple situation to the degree I only thought my wife was capable of. I'm going to 'answer the charges', not to satisfy you, but to legitimize myself for anyone who comes across this. I do corporate systems management and administration stuff and frequently want to do so in a quite automated fashion.

1. The script I want to auto launch and delete, simply prompts the user to rename the computer. This script will be preloaded into a local administrators account on my corporate disk image. When a new machines come in and gets imaged, the admin logs in and is immediately prompted to name the machine, the script disappears, nice and clean. Sorry, no voodoo there.

2. Have you ever migrated local user accounts to AD user accounts? Well, I do. It's easy to bind to AD and start authenticating via AD. In order to maintain the users old local home, you have to rename the local home to the users AD login name, and then chown the folders permissions. The only negative side effect of this is when the user logs in with the new credentials, Login Keychain pitches a fit. I was looking for a way to deal with that so that the user didn't have to. Wow, guess I was actually looking out for the innocent users on that one, Ehh?

3. The project I'm on now is to bring some normalcy to 300 unmanaged Macs in a corporate environment. Every Mac has a single administrative account that the user set up, and they're ALL different. It's a help desk nightmare. One of the goals is a uniform admin account on every machine, with ARD access enabled for that account. Trying to impact the user as little as possible, and hide the account so that the more able do not go deleting the account we've created.

Sorry to disappoint you in your quest to 'out' devious behavior. Better luck with your next target.

Darrin

Jun 19, 2009 10:26 AM in response to DPert

And you've over-engineered a solution to a problem that doesn't exist. AppleScript will not do a few of the things you're trying to accomplish, and even if it would, you're still in the position of manually installing this script on all 300 machines, so why don't you just run it right then and there and not worry about whether or not it fires at the next login?

If you insist on pursuing this, and a career in Mac systems management, I'd suggest you read some launchd documentation.

Jun 19, 2009 11:04 AM in response to RanjeetJones

Heh, yes, I do need to learn more about launchd and advanced scripting in general, no argument there.

No. I'm not in the position of installing this script on 300 machines. I'm installing it in my base disk image, and I want it to launch at first admin login to ensure that the junior tech who is deploying does not overlook naming the machine properly with department code and asset tag number.

Man! Tough crowd here!

Jun 20, 2009 8:26 AM in response to DPert

Two comments.

1) You should have explained the detailed objectives in the first place because the requested measures can be used maliciously.

2) Even with the explanation you've given here later in reponse to my message, I won't help you. It is because a system administrator who is in the position to manage 300+ machines should have already known this sort of basics or at least should have been able to find them by himself/herself.

Discreet medical doctor will not tell a layman how to administer an anesthetic.
H

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Self Destructing script

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.