Admin privileges without 'do shell script'

I'm trying to copy a file (actually an application bundle) to a non-administrator user's Applications folder. The message is "The operation could not be completed because you do not have enough access privileges". This has worked in the past, however.
If I do the copy manually I get the standard "The Finder requires that you type your password" message.
I prefer not to use a shell script because I then have other problems, also concerning privileges or ownership, as I recall. Is there a way to do the equivalent of "with administrator privileges" in the copy below?
-- mypath has been set to the folder containing both the script and file/folder to be copied.
try
tell application "Finder"
activate
if exists folder "Images" of folder "Applications" of folder ¬
"Operator" of folder "Users" of startup disk then
select file "Bundle" of folder "R" of folder myPath
copy selection to folder "Images" of folder "Applications" of folder ¬
"Operator" of folder "Users" of startup disk
else
display dialog "(Couldn't find folder Images)"
end if
end tell
G4 Mac OS X (10.4.2)

As for privileges, try running a blank do shell
script "" with administrator privileges on the
line just before your copy/duplicate.
Thanks, but the only change is that now the message now says, "Finder got an error: a privilege violation occurred."
I had actually done a shell script with admin privileges in the same Applescript, so I'm surprised this change had any effect.
I'm working on software that used to run on OS 9, and it is a gross understatement to say that working with OS X's implementation of ownership and permissions has been a nightmare for me.

Similar Messages

  • Applescript: Admin Privileges

    It's my understanding that you can only use "with administrator privileges" for a shell script.
    In my AppleScript, I have several statements as follows:
    duplicate POSIX file "/path/to/file" to POSIX file "/path/to/file" with replacing
    The new location of these files requires an administrator username and password to modify it. The script runs without error and works exactly as I intended, except that Finder asks the user to enter their password for every single file that's moved. Is there any way I can just have them enter the password once to grant permission to move all the files?

    OK... almost there. That part of the code works flawlessly now. The very last step of the code involves finding and removing a file. I have:
                                    set toRemove to do shell script "sudo find /path/to/folder -name nameofthefile"
                                   do shell script "sudo rm" + toRemove + ""
    toRemove correctly stores the POSIX file path. However, once it gets to the "sudo rm" line, it gets an error. I assume it is some sort of type-conversion error?

  • Passing parameters in a shell shel script

    Hi everybody,
    I am working on a task which gets report on every remote database.
    I created a small database: ‘REPORTS_DB’ and I created 6 'sql' scripts on that database. While executing the first script, it calls the other 5 different 'sql' scripts. All these 5 sql scripts use a '@db_link' (hard coded) and gets that database's report to the database: REPORT_DB.
    It is working good. But,
    We have 42 databases and I have to get reports of all the 42 databases. Since it is not efficient to create 42 sets of sql scripts, I want to make it automated.
    I know (but I don't know HOW) I can pass a parameter (database link name) while running the first script (which calls the other 5 scripts), so that the parameter replaces the @db_link in all the 5 scripts and gets the report of the related (@db_link) database.
    Could somebody send me a sample shell script to do this task?
    OR, is there any way to do this task without using shell script ?
    (BTW, we are using korn shell on sun Solaris)
    Thanks in advance.
    - JT

    Hi everybody,
    I posted same question earlier for UNIX/shell script and rec'd one response. Thanks to Bob.
    But the requirement has been changed and now my mgr wants the same task using PL/SQL. Could somebody help me ?
    Question again....
    I am working on a task which gets report on every remote database.
    I created a small database: ‘REPORTS_DB’ and I created 6 'sql' scripts on that database. While executing the first script, it calls the other 5 different 'sql' scripts. All these 5 sql scripts use a '@db_link' (hard coded) and gets that database's report to the database: REPORT_DB.
    It is working well. But,
    We have 42 databases and I have to get reports of all the 42 databases. Since it is not efficient to create 42 sets of sql scripts, I want to make it automated.
    I know (but I don't know HOW) I can pass a parameter (database link name) while running the first script (which calls the other 5 scripts), so that the parameter replaces the @db_link in all the 5 scripts and gets the report of the related (@db_link) database.
    Could somebody tell me how to do this task using SQL and PL/SQL ?
    OR
    send me a sample PL/SQL script to do this task?
    Sorry for the inconvenience and thanks in advance.
    - JT

  • Do Shell Script .. with Administrator Privileges ... ?

    hi everyone!
    I have a script that have multiple lines like this:
    do shell script " ... " with administrator privileges
    do shell script " ... " with administrator privileges
    Mac OS X 10.4 does it right(?) by asking ONCE for an admin login/password, and would run both lines above ... but 10.2 (and 10.3?) asks TWICE for the password using the same code. What am I doing wrong? I want all versions 10.2-4 to ask only once ... Any ideas?
    Thank you!!
    Cass

    If you would prefer that your script would not ask for a password to get admin privileges, then this uses the keychain:
    set aVariable to do shell script DefinedAsVariable password getPassw() with administrator privileges
    -- The Handler --
    The following handler assumes you have a password in your keychain called ASPW (could be anything you want) saved as a generic key. To do that, open your Keychain Access (in Utilities) application, choose file New, and in the sheet give it a name, enter your account name and type the password you want to use (your admin password in this case). OK. Now find the new password and double-click it. Under the attributes tab change Kind to generic key (it will be Applications). This makes for a fast search because there aren't many of them. Switch to the access control tab and select the "Allow all applications to access this item" button. Enter your admin password in the dialog that appears, and you are done. The first time you run the script, you'll have to click "Always Allow" in the dialog that appears - perhaps several times. After that, it won't ask.
    to getPassw()
    tell application "Keychain Scripting"
    launch
    tell current keychain to ¬
    tell (some generic key whose name is "ASPW")
    return password
    end tell
    end tell
    end getPassw

  • Shell Script Adapter - what kind of sudo privilege needed?

    Hi All,
    I have a requirement in my project where I need to manage unix user provisioning and de-provisioning by using shell scripts in AIX servers. For this purpose, I selected Shellscript adapter as it allows us to execute scripts that run on the resource.
    1. while I have account in the AIX server, I need to know what kind of sudo privilege is needed. Will I need sudo access to root? if yes, does it mean, I (or my account) should be added to root? please let me know.
    2. also, I tried configuring the adapter using the login id, host, password, login shell prompt, port and SSH. When i tried to test the configuration, it gave the following error,
    Test connection failed for resource(s):
    Shell Script: Failed to find 'useradd' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' Shell Script: Failed to find 'usermod' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' Shell Script: Failed to find 'userdel' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' Shell Script: Failed to find 'groupadd' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' Shell Script: Failed to find 'groupmod' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin' Shell Script: Failed to find 'groupdel' in the path '/usr/bin /etc /usr/sbin /usr/ucb /home/eumusr/bin /usr/bin/X11 /sbin . /usr/local/bin'
    I am wondering why should it search for these commands? please let me know.
    thanks.

    Hi All,
    I got this issue resolved after a fine-grained sudo setting to the account that is used for provisioning.
    The revised sudo setting was able to do all the provisioning tasks without having a root access.
    This is what I set on my service account
    (root) /bin/awk, /bin/cat, /bin/cp, /bin/cut, /bin/grep, /bin/login, /bin/mv, /bin/rm, /usr/bin/auths, /usr/bin/cat, /usr/bin/chgroup, /usr/bin/chgrpmem, /usr/bin/chsec, /usr/bin/chsh, /usr/bin/chuser, /usr/bin/cp, /usr/bin/last, /usr/bin/lastlog, /usr/bin/listusers, /usr/bin/logins, /usr/bin/lssec, /usr/bin/mkgroup, /usr/bin/mkuser, /usr/bin/mv, /usr/bin/passwd, /usr/bin/profiles, /usr/bin/pwdadm, /usr/bin/rm, /usr/bin/roles, /usr/sbin/groupadd, /usr/sbin/groupdel, /usr/sbin/groupmod, /usr/sbin/lsgroup, /usr/sbin/lsuser, /usr/sbin/rmgroup, /usr/sbin/rmuser, /usr/sbin/useradd, /usr/sbin/userdel, /usr/sbin/usermod, /usr/sbin/logins
    (root) NOPASSWD: /usr/bin/chgrp, /usr/bin/chmod, /usr/bin/chown, /usr/bin/chpasswd, /usr/bin/cp
    In this way, you need not have to be a root user to perform provisioning using AIX.
    Hope this helps!!
    thanks.

  • Since I have updated to Firefox version 5, my Firefox browser just hangs when I am logged in to my laptop without Admin privilege. If I am logged into my laptop as Admin then Firefox is working well is this a known issue.

    Since I have updated to Firefox version 5, I cannot use Firefox on my laptop as a normal user without Admin privilege. Whenever I try to run Firefox, the browser window just says connecting and hangs. It looks like it also uses all the CPU and stops all other processes on the computer. Even the computer clock stops working.
    If I am logged into my laptop as Admin then Firefox works well as it used to with previous versions. I am using Windows XP service pack 3.

    Hi Tylerdowner -
    Thanks for your suggestion.
    I already tried a Reset, but all that did was lose all my settings , search engines etc. and one or two add-ons - as expected.
    I also already tried updating my graphics driver - both manually, and with Windows Update (Automatic Updates is set to ON anyway, and I've checked the optional ones as well, and though there was nothing relevant there, I installed most of them anyway!) Apparently I'm using the most up-to-date and appropriate driver already!
    Oh dear........
    Going to try turning off hardware acceleration next....

  • BI Admin Tool - Setting connection pool via shell script - Is it possible?

    Hi,
    Here's the problem I am trying to solve.
    I am using a J2EE application that uses OBIEE for reporting.
    The *.rpd file is installed at a particular location when our J2EE product is installed.
    I then copy the *.rpd file to the BI home on a different server using a shell script.
    The shell script that deploys the *.rpd file does the following:
    1. Shuts down BI processes that are running
    2. Deletes the old *.rpd file
    3. Copies the new *.rpd file
    4. Starts all BI processes
    I am happy with the way we have automated this process, but would like to take it one step further.
    The *.rpd file does not have the connection pool hard-coded in it. And we want to keep it that way.
    What we would like to do is - pass the connection pool parameters to the shell script (that is used for *.rpd's deployment) and have it automatically update the *.rpd file. Is it possible to do this at all? How do we go about accomplishing this?
    Or in other words - Is there a way to update the connection pools WITHOUT hard-coding it in the *.rpd file or WITHOUT using the BI Administration Tool.
    Currently, we manually update the connection pools in the Physical Layer using the Oracle BI Administration Tool.
    The version of BI Administration Tool being used is 10.1.3.3.1 installed on a Microsoft Windows XP Professional SP2 machine. The BI Server itself is running on an Oracle Enterprise Linux 4.0 box.
    Do let me know if you need more information that would help answer this question.
    Thank you.

    Thank you - fiston and Gagan.
    I am going with fiston's solution - since it is easier to implement. I am on the QA team and the automated deployment is to lessen QA's deployment time.
    While one of our developer's said that she prefer's Gagan's solution - it would be over-kill to make changes to the application's schema for the said purpose.
    I will further make another post as to whether or not the automated deployment worked for us.

  • How to run Adobe InDesign CC without needing Domain Admin privileges?

    Adobe InDesign CC needed Admin privileges to install which is fine but it seems to need the same just to start-up and run the program.
    I've given the user Local Admin but that didn't fix it. I don't want to have to 'Run as Administrator' every time they want to use the software, does anyone have any ideas for sorting this?

    Without proper system info and other details nobody can even begin to guess. Chances are that your network configuration is to blame and due to using specific ports that are also used by the activation system they are somehow tied together. Well, whatever. This is most definitely nothing that can be solved from within the Adobe programs themselves. Run a network monitor, find out what's wrong and fix it accordingly.
    Mylenium

  • Flash Player Administration - upgrade users without admin privileges

    Is this possible? How have you answered this painfully obvious problem in your enterprise?
    We have a remote Sales Force which do not connect to our domain. I looked through the Admin Guide - I do not want to disable the auto-update. I want to make the auto-update work for users without admin privileges.

    Currently, the user does need to be an admin account for an update to occur.  However, the good news is that this will change in 11.2.  Once 11.2 is installed on Windows (using an admin account), there won't need to be further user interaction for future updates.  Users on limited accounts will be updated silently, without admin interaction.
    Chris

  • X200 Laptop WWAN ATT Communicaton Manager 6.10 to work without Admin Privileges

    Hello newbie to this forum....I have x200's I deploy in a corporate environment and we do not want to use the access connection software from Lenovo.  ATT Comm Mgr works with admin privileges but when you remove it it just hangs and never connects.  Everything lights up signal strength is good.  Does anyone know where in the registry or what hack to get this software to work without admin rights?? Contacted Lenovo and they only want you to use Access Connections and ATT is no help either.  Any help would be greatly appreciated!! thanks

    Hi x200RQ, and welcome to the Lenovo User Community.
    This is not a direct answer to your question, but you can use AT&T WWAN without either Access Connections or AT&T Communications Manager. Here are the AT&T instructions for this in Vista and XP.
    This might get you where you want to be... tell us if that helps.
    I don't work for Lenovo. I'm a crazy volunteer!

  • Reset Password without Admin Privileges

    I am using the latest APEX hosted via apex.oracle.com. I'm trying to create a 'forgot password' capability but it appears that every built-in apex utility that allows me to reset and/or update the password requires admin privileges. Is there any way to do this without having admin privileges? I'm using APEX Authentication.
    Thanks,
    Mark

    Hi Mark,
    Create an authentication function with two parameters something like this and follow the link to create a custom authentication scheme.
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/sec_authentication.htm#HTMDB25778
    function my_authentication (
        p_username in varchar2,
        p_password in varchar2 )
        return boolean
    is
        l_user my_users.user_name%type := upper(p_username);
        l_pwd  my_users.password%type;
        l_id   my_users.id%type;
    begin
        select id  , password
          into l_id, l_pwd
          from my_users
         where user_name = l_user;
        return l_pwd = rawtohex(sys.dbms_crypto.hash (
                           sys.utl_raw.cast_to_raw(p_password||l_id||l_user),
                           sys.dbms_crypto.hash_md5 ));
    exception
        when NO_DATA_FOUND then return false;
    end;
    and
    my_authentication

  • Automatic Adobe Update for users without admin privileges

    Hi there,
    I have a PC with Windows 7 Professional (32bits) and Adobe Reader (9.4.6)
    I have selected "Automatically install updates" in Preferences --> Updater:
    The problem is: when a normal user (without admin privileges) is using the system, it turns up an Adobe Box which asks the user to install the Update:
    But when the user tries to update, it asks to insert the admin password.
    How can I solve this? I would like Adobe Reader updates to be downloaded and automatically installed for users in my PC without admin privileges. Is this possible?
    Thanks in advance.
    Best regards,
    Pablo

    Anyone have any further insight into this?  Is there a way to simply give the user admin creds but only for Adobe Reader that would permit users to do thier own updates?
    I don't want to have to constantly update the MSI I am deploying with GP/LUP if possible.
    I am, however simply looking to update 11.0.0 to 11.0.1 ,11.0.2....etc without having to touch GP/LUP/each end user machine

  • How do I start Firefox in Debian 5 directly from shell script without a dialog asking what to do?

    Running Debian 5.04. I downloaded the tarball from Mozilla website and extracted the files to my home directory. When I double-click on the Firefox start-up shell script, I get a dialog window asking if I want to run ina terminal window, display the shell's contents or run the program. Choosing "Run" starts Firefox successfully, but I'd like to by-pass the dialog and just have Firefox start. How to do this? TIA
    == This happened ==
    Every time Firefox opened
    == I unpacked the tarball to my home directory. ==
    == User Agent ==
    Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.0.19) Gecko/20080528 Epiphany/2.22

    Right click on the desktop and choose 'Create Launcher'. There enter the details so start the program directly not via a script. This did the trick for me for another program.

  • Running Palm Desktop without Admin Privileges?

    I'm trying to get Palm Desktop 6.2 working on my company's Win 7 laptop. To get it to (mostly) work, I had to install using the administrator password.  In its wisdom, the company does not give me permanent admin privileges but provides a temporary checkout mechanism for the administrator password.  Palm Desktop will only run only if I run it as administrator with the password enabled and checked out (and entered when the program is run), an incredibly tedious procedure just to run Palm Desktop.  Is there any way to do the password checkout just once and enable running Palm Desktop just as a user to avoid this tedious procedure?  Otherwise, running as a user, Palm Desktop will just hang at the splash screen.  I tried changing privileges (UAC) to all the program files in the Programs (x86)\Palm folder to allow access to users but that didn't help.  Is it to the data as well?  Thanks in advance for any help.
    mraki
    P.S.  I posted earlier with the missing files problem listed in the registry (Annanotifier.dll, pdn20.dll, AlarmNotify.dll, EASNotify.dll) and these still post a HotSync missing files error but seem to cause no problem other than the error message.  Thanks for any help here as well.

    I'm afraid I have no personal experience with what you're attempting to do...  
    All I can remember is that Full Admin rights were supposed to be granted to the user account during the entire installation of Palm Desktop, and a successful HotSync performed.  Whether the check-out routine is doing this is beyond me.
    Once the above is complete, the rights can be revoked back to "User".
    You might want to search over at Brighthand.com for some information on this subject.
    WyreNut
    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

  • Run shell script as sudo user without giving sudo passowrd from normal usr

    Hi ,
    i am running shell script from my account with sudo user what is the problem in my procedure.
    Please if any thing wrong in my procedureprocedure or any permission required please let me know.
    here is the my procedure and sudo permissions.
    [techm@ppsol04 ~]$ sudo su - dadm sudo -u dadm /u01/ora/tools/Dbmon/scripts/export.sh
    Sorry, user techm is not allowed to execute '/u01/ora/tools/Dbmon/scripts/export.sh' as dadm on ppsol04.
    [dchandu@ppsol04 ~]$ sudo -l
    Matching Defaults entries for techm on this host:
    env_keep=SSH_AUTH_SOCK, !authenticate, env_reset, always_set_home, !requiretty
    sudo permissions :
    sudo -l
    Matching Defaults entries for techm on this host:
    env_keep=SSH_AUTH_SOCK, !authenticate, env_reset, always_set_home, !requiretty
    User techm may run the following commands on this host:
    (ALL) NOPASSWD: /local/bin/hardened_profile.sh
    (root) NOPASSWD: /bin/su - dora
    (root) NOPASSWD: /bin/su - doraadm
    (root) NOPASSWD: /bin/su - docenter
    (root) NOPASSWD: /bin/su - tora
    (root) NOPASSWD: /bin/su - toraadm
    (root) NOPASSWD: /bin/su - tocenter
    (root) NOPASSWD: /bin/su - hora
    (root) NOPASSWD: /bin/su - horaadm
    (root) NOPASSWD: /bin/su - hocenter
    (root) NOPASSWD: /bin/su - agcfdwf4
    (root) NOPASSWD: /bin/su - pora
    (root) NOPASSWD: /bin/su - dadm
    (root) NOPASSWD: /bin/su - pocenter
    (root) NOPASSWD: /bin/su - agcfdwp4
    Thanks
    tech

    Can you please explain what you are trying to accomplish?
    To my understanding there is no such thing like a sudo password for a normal user. Sudo allows users to become root based on a sudo list (suoders). The user is then prompted for their own account password to run as super-user or root.

Maybe you are looking for

  • How do I sync files on Mac mini and MacBook pro

    I want to sync files between my Mac Mini and my MacBook Pro. Is there a way to do this? Primarily, I want to access photos in my LightRoom Catalog from both platforms. Thanks for any help you can provide.

  • Frame 12 Server documentation videos don't work

    I've tried to get the embedded videos in the Frame 12 Server documentation (e.g., "Getting Started Guid") to work under multiple browsers to no effect.  Clicking on them results in nothing happening.  Here's my case in point:  Quite a pity since the

  • Change source in multiple pages

    I am trying to find out already for long time, but can't seem to find it: I made a mistake with making a photo gallery and now all the seperate photo pages have a mistake in the photo src (link). It's easy to fix, but now I have to do it by hand for

  • Event creation with status management

    Hello esteemed gurus ... it's your friendly workflow noob again It seems once people get a sniff that there is a someone who knows a bit about workflow in the company, everyone wants a piece of you! So... I have been asked to setup a workflow that wi

  • MD5 and Checksum Collisions ... A problem in APEX?

    There is a glut of information on the internet about the weaknesses of MD5 as a hash calculation. For example, <a href ="http://lookit.typepad.com/lookit/2006/10/a_new_demonstra.html">here</a>, here, and even a number of examples on how to easily gen