Help Making an Applescript allow a application to run closed system

I am trying to bypass the having to enter the user name and password inroder to run an application on my student computers.

I know that I can bypass entering the password using an applescript shell command

	do shell script "command" user name "My School" password "mypass" with administrator privileges

But I would like to be able to run this application without having to enter in the admin name and password, it becomes a pain when installing new software on 50+ machines.

I was wondering if anyone had a solution.

Regards,
paulmattallen

The optional user name and password arguments to do shell script can only be used to run shell commands as root, they are not a general hook into the authentication mechanism provided by the system. There is no way do shell script can help with every kind of authentication requested by applications, plugins, extensions, or the system itself.

You mention getting a prompt before running the application, but later you talk about “installing new software”. Does the prompt only happen when you install the software? Just the first time you run it? Every time you run it?

If the prompt is coming up during installation from a pkg or mpkg, you might be able to use do shell script . with administrator privileges with the installer program to install as an admin without a prompt.

If it is the application itself that is prompting, then the problem is more complicated. Does it prompt every time you run the application? Does the application itself actually run as an admin user, or does it only do a few accesses that require admin rights?

If it only prompts the first time you run it, you might try running it through do shell script . with administrator privileges. You will have to lookup the application’s “executable” name from inside the application bundle (if you do not already know what I mean, then do not try this). This will run the application as root, which is generally not a very good idea, may not work, may cause the application to behave inappropriately (it could do bad things to any part of your system!), may add other complications, and may not even solve your “prompts for authentication” problem.

If it is prompting every time it is run, the application is probably not designed to run as a non-admin user. You are working against the intended use of the program.

In either case of the application itself doing the prompting, you should talk to the developer to see if it can be modified to work under a non-admin user.

Or you could simply (haha) upgrade all your users to admin status.