Discussion in 'macOS' started by escobar187, Feb 22, 2011.

  1. escobar187 macrumors newbie

    Jan 24, 2011
    I'm trying to run multiple scripts when the user login.. I know the command to run loginhook but that command will runn only one script.. how can i run multiple scripts ?

  2. larkost macrumors 6502a

    Oct 13, 2007
    There are a few solutions:

    1) Have one master script that runs other scripts. There is a lot of flexibility possible here.

    2) Use MCX and multiple containers (machine, users, groups, etc) to have multiple loginscripts (a bit of a hack).

    3) Add multiple items to the LoginItems (sometimes a similar effect)

    4) Rather than using loginhooks, create your items as LaunchAgents. This is far more flexible, but takes a bit more care.

    5) If you need to run very early in the login process, then a SecurityAgent plugin is possible, but this is far more difficult than any other option.

    All of these have their plusses and minuses, and what is the most suitable depends a lot on what you are trying to accomplish.

Share This Page