I've recently been faced with a challenge at the library I work at that I need to make a small bit of code in MacOS High Sierra that I can't figure out for the life of me! I have some experience coding in Windows but have never used Macs before and I was really hoping someone here could help me, as its really hard to learn what I need to do with no basic knowledge of AppleScript.

Here is what I need this code to do.

  1. Login into an admin user from a non-admin user at a certain time
  2. Run a script in the admin user account
  3. Script reboots into Windows using bootcamp

I know that I can handle the 'certain time' portion by using the calendar app to run the code that actually does the work, and to boot into windows using this code, but I have been trying for hours to figure out switching users when I know someone experienced could do it in less than 15 minutes. Any help would be extremely appreciated!!!

  • First of all, welcome to Ask Different! :) Just setting your question aside for the moment, can you clarify what you’re actually trying to achieve overall? I’m asking because having that background/context may help us in case there’s actually a better way to do what you’re actually needing to do. As for your question, is the script you mention at step 2 the same script you’re linking to later? Also, why do you need to switch users? Or is it just that you want to be able to run the shutdown -r now command?
    – Monomeeth
    May 5, 2018 at 2:08
  • The bless command, used in your example code, will only work if System Integrity Protection is disabled. You probably would be better off using a boot manager, such as rEFInd. You could configure the rEFInd to silently boot to either macOS or Windows. May 5, 2018 at 5:25
  • Thanks for the quick replies guys. So what is happening is that the library Macs are left logged into the guest account with no admin privileges all day. The manager wants me to set them to reboot into Windows at a certain time for a library program that starts (say 4PM). I assume that it can only be done by an admin user so my understanding is that the Macs would first have to switch to an admin user, then commence the reboot. However, if this can all be done from the non-admin user using the admin password then that will work too. I can edit any settings on them if needed. Thank you! May 5, 2018 at 15:18

1 Answer 1


About the only thing you can do in 15 minutes is let the admin account be open to all the non-admin users and have unlocked your library macs to more admins.

Have a look at BootRunner which solves this problem for the entire lab. There is discount pricing and a free trial. Based on what you’re using to manage the lab - your MDM choice may dictate or handle this for you as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .