Automating+Volume+Blessing+from+in+Windows

Currently there is not a way to automate changing the startup disk from within Windows. The only way I was able to accomplish this was by using the free [|AutoIT] scripting utility to create an executable that can be called from a script -- I used a separate windows startup script to handle this. Here's the code for the AutoIT executable:

code format="text"
 * cs

AutoIt Version: 3.2.8.1

Script Function: Set the startup disk to MacOS X and restart the computer.


 * ce

Run("C:\WINDOWS\system32\Startup Disk.exe")
 * Run the Bootcamp Control Panel

WinWait("Startup Disk","")
 * Wait for it to open

If Not WinActivate("Startup Disk","") Then _ WinActivate("Startup Disk","")
 * Check to see if the window is active, if not then make it active

WinWaitActive("Startup Disk","")
 * Wait for the program window to become the active window

Send("{LEFT}") Send("^{TAB}") Send("^{ENTER 2}")
 * Select the Mac OS startup disk, and restart the computer

code

I've had good success with this utility, however occasionally I've had some machines fail to restart resulting in them staying in windows.

--1236553336