Skip to content

@robjwells /Restart in Windows.applescript
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Quickly restart your Mac into Windows
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
@anilnatha

Thanks for posting this. I've given it a try, and unfortunately, it always prompts the user to enter their username/password.

Is there any way of rebooting without the need for entering that information?

@robjwells
Owner

@slyraskal That’s by design. You can add password "YourPasswordHere" before with administrator privileges, but I do not recommend it as you’re effectively storing your system password in plain text.

@jwhitley

FYI, I forked this gist and modified it to use sudo before the bless command instead of the with administrator privileges clause. sudo in combination with an added line to /etc/sudoers allows passwordless use of the bless command, and only that command. See the comment on my gist for those details.

@robjwells
Owner

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
Something went wrong with that request. Please try again.