Last active
October 10, 2015 11:17
-
-
Save robjwells/3681949 to your computer and use it in GitHub Desktop.
Quickly restart your Mac into Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set deviceID to (do shell script "diskutil list | awk '/YourBootcampPartition/ {print $NF}'") | |
do shell script "bless -device /dev/" & deviceID & " -legacy -setBoot -nextonly" ¬ | |
with administrator privileges | |
tell application "Finder" to restart |
Anyone not wanting to type in their password should definitely check out @jwhitley's fork, and be sure to read his explanation in the first comment on that Gist.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FYI, I forked this gist and modified it to use
sudo
before the bless command instead of thewith administrator privileges
clause.sudo
in combination with an added line to/etc/sudoers
allows passwordless use of thebless
command, and only that command. See the comment on my gist for those details.