Rebooting to Windows 10 via Script

monosodium
Contributor

Hello All!

I believe this is a Windows 10 issue and not an El Capitan issue, but am not sure. In the past I had a script that would reboot to bootcamp (Windows 7) to run all my Windows patch management. Since switching some of my kiosk machines to Windows 10 I have noticed that this same script now produces this: b00df2ed1a2f455b9226605eafc7d49f

There seems to be an EFI version of Windows which isn't bootable. Anyone know of a way to boot to the non-EFI Windows version from a script?

My current script looks like this:

#!/bin/sh

/usr/sbin/bless -mount "/Volumes/BOOTCAMP" -legacy -setBoot -nextonly
/sbin/shutdown -r now

Thanks so much!

3 REPLIES 3

Look
Valued Contributor III

The Windows 10 is none EFI? It's usually efi by default I think (ours is although it was installed from sccm), in which case the legacy flag is probably not appropriate.

malroy
New Contributor II

@monosodium

Try this

bless --device /dev/$(diskutil list $(diskutil info $(diskutil list | grep 'Microsoft Basic Data' | awk '{print $NF}') | grep 'Part of Whole' | awk '{print $NF}') | grep EFI | awk '{print $NF}') --setBoot

and Look is correct, Windows 10 is using EFI , so you can't use -legacy flag

monosodium
Contributor

@malroy No luck with that. Choosing the startup disk via System Preferences works fine, but I really need a command-line version. I also tried it without the legacy flag and that did not change anything.

I should mention this is on 10.10, so no SIP issues should be present.