On a 2013 iMac running the latest Mac OS X, we have a Mac partition and a Windows 7 partition. The administrator can use the Boot Camp application to restart the Mac into Windows. The guest account however should also be able to use Boot Camp and restart into Windows. Is this in any way possible, because it seems you always need to enter the Administrator password in order to reboot into Windows?
You can use the following code to create an Applescript application to accomplish this.
do shell script "bless -mount \"/Volumes/Boot Camp Name\" -setBoot -nextonly" user name "admin username" password "admin password" with administrator privileges
do shell script "shutdown -r now" user name "admin username" password "admin password" with administrator privileges
You will need to:
- Paste the above code into AppleScript Editor
- Fill in your admin username, password and name of your bootcamp volume where necessary
Once your details are entered you can save the script for editing later and then export it (File > Export) as an Application, making sure to check the "Run-Only" box before clicking Save. What this does is create an AppleScript application that can only be run, not edited or viewed. When you launch the application your Mac will temporarily reboot into whichever volume you specified in the code.
The following accomplishes this:
bless & setboot - This designates the default startup disk
nextonly - This tells the system that the volume designated in this command should only be the startup disk for the following boot, subsequent restarts will boot to the proper startup disk.
shutdown -r now - This tells the system to reboot now
Exporting as a run-only AppleScript application allows the students to execute the command but not view the contents, which should keep the admin credentials safe. I made a sample application on my system and was unable to view the script inside the application by digging through the package contents. It may be possible to get around this but I couldn't find a direct way.
To make this accessible to Guest users in addition to standard user accounts you could add it into the default user template at /System/Library/User\ Template/English.lproj/. Settings, files, etc in this location carry over to the "on the fly" Guest accounts available in the newer Mac OS X revisions.
Hopefully that does the trick for you!
You can boot into Windows without needing to change the Startup Disk.
Simply hold ⌥ alt/option whilst the system is booting to have the option to select a boot drive. From there, you can select the Boot Camp partition. Next time the machine reboots, it will reboot into OS X unless you repeat the procedure.
BootChamp is a menu bar app that allows you to reboot into Windows on the next boot.
Admin is only required the first time this is carried out…
The first time a restart is initiated with BootChamp, it will ask for the admin password. After this initial process, you will no longer need to enter your admin password again.
The next time the machine boots, it will boot back into OS X.
BootChamp does not modify your startup disk, it only temporarily sets the startup disk for the next restart.
You can add this to the Guest account by adding it to the Guest user template at
/System/Library/User Template/English.lproj/. The simplest way may be to log in as a Guest, then install BootChamp as a login item, give it your administrator password, and copy the contents of the Guest account to that folder.
Alternatively, you could use Workgroup Manager to add it as a login item.