Benches macOS

3

Terminal - Bless - Cannot get the "-nextb…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

My computer: MacBook Air with Windows XP SP3 installed on a NTFS Bootcamp partition, and I'm currently under Mac OS X 10.5.4

Hi all!

I searched all around the Internet to find a quick way to reboot my computer from Mac OS X to Windows XP with the lowest user interaction possible, and I came up with the following Terminal script (for instance):

*bless -mount "/Volumes/Windows HD" -legacy -setBoot -nextonly*

*shutdown -r now*

This actually works with no error output, but the thing is that my computer (MacBook Air, 10.5.4) reboots in Mac OS X each time intead of booting in Windows XP.

So I tried the following:

*bless -mount "/Volumes/Windows HD" -legacy -setBoot*

*shutdown -r now*

This worked perfectly, the system rebooted in Windows, but the problem is that Windows becomes the default system, which is wrong for me.

Since I use a NTFS partition for XP, I also tried the following:

*bless -device /dev/disk0s3 -legacy -setBoot -nextonly*

*shutdown -r now*

I had the same results with this script, the computer does not restart in Windows as intended. So here is my question:

Is there a way to make the "-nextonly" swith work properly on my computer? Is this issue OS-specific or a hardware specific problem? I'd like some other people with a MacBook Air AND Windows XP (NTFS) to test this, so we could see if this only occurs to me and try to find a proper workaround for this problem (I don't want to use either the preference pane nor the command key at startup).

Note: In Script Editor, I also used the "with admistrator privileges" option that come along with "do shell script", and I repaired permission with Disk Utility without any apparent results.

For those who are using similar scripts to those above, did you experienced problems in the newest Leopard version?

Thanks a lot for your help!

Kind regards,

Yannick

3 replies

Sign in or join Beachball Help to reply.

  1. 0

    V.K.

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    can't really help you but the first command

    *bless -mount "/Volumes/Windows HD" -legacy -setBoot -nextonly*

    *shutdown -r now*

    \

    works correctly for me. It has to be run with sudo of course. Don't know why it wouldn't work for you. try zapping PRAM.

  2. 0

    Scott Radloff

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    ygauthier,

    At boot, the startup manager queries PRAM to determine where the boot volume is. This proceeds without interruption, unless there is specific input from the keyboard. If, for example, the option key is being held down, the startup manager displays its interface and waits for user interaction.

    I'm not really certain that this will get you anywhere; the easiest way to boot into an alternative OS is to use the option key. It adds perhaps 4 seconds to the boot/reboot process: Hold option key for about 5 seconds after the chime, use arrow key to highlight the alternate OS, press <RETURN>. That's pretty darned simple and quick. One advantage to this is that the process doesn't touch the PRAM settings, so a simple reboot automatically returns to the "main" OS.

    Put more simply, use option to select and boot into Windows (quick and easy), then just restart to boot back into OS X (even easier).

    At any rate, you'll probably need to use Applescript to do what you want (if it's possible; I haven't investigated it). In this case, you would script the "Startup Disk" preference pane to make the necessary PRAM change (which is what the Startup Disk preference pane does).

    Scott

  3. 0

    ygauthier

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    It appears that a PRAM reset is the solution. However, it is not possible to do a PRAM reset if a password on bootup is set. It must be deactivated first.

    Thank you to both of you for your precious help, now my script works as intended.

    Kind regards,

    Yannick