Painless restart to windows with Alfred/Shell script V2
some time ago, I wrote a script for quickly restarting to windows. in first version, you had to add your partition to the script. in the new version, that is not necessary anymore.
This workflow asks for your password each time. In order to get around this inconvenience, you need to edit sudoers file.
sudo nano /etc/sudoers
%admin ALL=(ALL) ALL add this line (replace Username with your username)
Username ALL = NOPASSWD: /usr/sbin/bless
Username ALL = NOPASSWD: /usr/bin/osascript
Remember Username is your mac username.
that is it! you’re done. Happy restarting my lazy friends :)
in case you don’t have Alfred, you can save this Apple Script on your desktop. it works the same way
tell application “Finder”
set iconPath to (get name of startup disk) & “:Applications:Utilities:Boot Camp Assistant.app:Contents:Resources:DA.icns” as alias
do shell script “bless -mount /Volumes/BOOTCAMP/ -legacy -setBoot -nextonly; shutdown -r now” with administrator privileges