Flying Visits with Boot Camp: The Switcheroo
Within days of my iMac arriving last November, I had partitioned my Macintosh HD and installed Windows using the Boot Camp Assistant. It wasn’t that I missed the familiar Start menu or sand timer of XP, just that there are some things I can’t do in OS X.
I love the simplicity of Boot Camp, but every time I switch and see that loading screen appear I can’t help but be filled with dread. Consequently, I’ve found myself looking for ways to ease the process.
Whenever I boot into Windows, it’s for one of three reasons:
- C++ Development (for my A-Level computing course)
- Testing sites in IE6 and 7 (thank goodness for Multiple IEs)
- Gaming
Having such regimented visits has made it easier for me to slipstream each boot depending on my reason for switching. I can go in, do what I need to do and get back to Leopard as soon as possible.
This post will hopefully be the first of many on little things designed to take the pain out of switching OS and minimise your time spent in Windows.
One-Click Reboots with AppleScript
On my desktop, there’s an alias labelled “XP Boot” that lets me quickly switch between operating systems with minimum hassle. To create your own, paste the following into Script Editor (located in the AppleScript directory in Applications):
set white_list to {"Finder"}
try
tell application "Finder"
set process_list to the name of every process whose visible is true
end tell
repeat with i from 1 to (number of items in process_list)
set this_process to item i of the process_list
if this_process is not in white_list then
tell application this_process
quit
end tell
end if
end repeat
on error
tell the current application to display dialog "An error occurred!" & return & "This script will now quit." buttons {"Quit"} default button 1 with icon 0
end try
do shell script "bless -mount '/Volumes/WINDOWS VOLUME/' -legacy -setBoot -nextonly" password "PASSWORD" with administrator privileges
do shell script "shutdown -r now" password "PASSWORD" with administrator privileges
The first half of the script quits all running applications (apart from Finder) and the second sets the boot partition to your Windows drive before restarting. The script does not set Windows as the default OS, just enables it for the next boot.
You’ll need to change WINDOWS VOLUME to whatever your C:\ drive is called ("Untitled" by default; if you want to change it, you’ll have to boot into Windows, right click it in My Computer and set a name in Properties). Both PASSWORD placeholders will also have to be filled with your admin password.
If keeping your Mac secure from snooping guests is a factor, you’ll want to remove both password "PASSWORD" segments from the script. It will still work but will prompt you for an admin password every time it runs. If you leave the password in, it will be readily available to anyone who knows what they’re doing but will save you the hassle of typing it every time.
Once you’ve changed the volume name and passwords, hit compile and save the script with File Format set to Application. If you wish to receive a confirmation dialogue before your Mac reboots, tick Startup Screen under Options.

Now just create an alias for the script wherever you like, perhaps give it a pretty icon, and you’re away!
In future posts, I’ll share some tips on saving time once you’re successfully booted in Windows.