Skip to main content
Question

Rebooting to Windows 10 via Script

  • June 4, 2016
  • 3 replies
  • 34 views

monosodium
Forum|alt.badge.img+11

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:

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

Forum|alt.badge.img+16
  • Valued Contributor
  • June 5, 2016

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.


Forum|alt.badge.img+4
  • Contributor
  • July 13, 2016

@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
Forum|alt.badge.img+11
  • Author
  • Contributor
  • July 18, 2016

@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.