And I don't want to change the boot drive every time I want to boot to Windows. When I'm done with Windows I like to just reboot and leave knowing the rest will just happen.
I came up with this little script:
#! /bin/bash diskutil list > /tmp/connecteddrives.txt INPUT=/tmp/connecteddrives.txt driveid1=$(grep Microsoft "${INPUT}" | awk '{print $8}') echo $driveid1 sudo /usr/sbin/bless --device /dev/$driveid1 --setBoot --legacy --nextonly rm /tmp/connecteddrives.txt exit 0
To find out if it will work simply type this into terminal:
diskutil list|grep Microsoft|awk '{print $8}'
If you get something along the lines of disk#s# it works. If not change the number 8 up or down by one till you find it. Then modify the script accordingly, make it executable and enjoy.
[crarko adds: I don't use Boot Camp, so I haven't tested this one.]