topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 12:02 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: How to do shortcut bat files to choose next login OS - dual boot 7 - 8  (Read 7692 times)

glnz

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
 
Wow - this is a very interesting web site. 

Apologies if I'm doing this wrong.  But I was sent here per a suggestion in Windows Seven Forums - see
LINK - How to do shortcut bat files to choose next login OS - dual boot 7 - 8

If you read that link, you'll see I have set up a Dell PC to be dual-boot between Win 7 Pro 64-bit and Win 8 Pro 64-bit.  Many of you here will appreciate that it's very clunky to REBOOT into the desired OS - many steps in each case.  I thought it would be great to have TWO shortcut or bat files (or similar) on each desktop.  One would reboot into Win 7 and the other would reboot into Win 8.  (That's four bat files total, folks, two for the Win 7 desktop and two for the Win 8 desktop.)

Two good reasons for this:  First, would be easy and fast for anyone.  Second, I frequently remote into this home PC from work, and I know I will need to reboot remotely and with confidence from time to time.

Right now, to do this manually, there are two routes I know of, and maybe one of them is good for the bat files I have in mind:

A)  ► Right-click on the desktop icon "Computer" and select Properties - this brings you to System - click Advanced System Settings - Startup and Recovery - Settings - System Startup - Default Operating System - [select which one and short time to display list of operating systems] - OK - manual Restart

B)  ► Run [Windows+R] - msconfig - Boot - [select the OS] - maybe check No GUI boot - Apply* - OK - a Restart prompt comes up and hit Restart
            * But "Apply" is dicey - it's greyed out unless I toggle something on and off.

Well, what do you all think?

One further thought.  I actually have a bat file on my old single-boot XP desktop that restarts the machine securely after a short delay (which lets me close my remote app before the rebooting actually starts).  Its only line is
shutdown -r -f -t 20
It's good because it has the -f force all applications to close and it has the -t 20 which gives me 20 seconds to close my remote app before the reboot starts.  And instead of a bat file, this could be a shortcut that "points" to a very similar line, like
%windir%\system32\shutdown.exe -r -f -t 20
Ideally, your new desktop bat or shortcut files for my more complicated Win 7+Win 8 dual boot PC will have similar features.  But please don't get hung up on those right away - want to see what the reboot into target OS will look like even without those features.

Many thanks !!!

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,644
    • View Profile
    • Donate to Member
An alternative: NeoSmart iReboot

6413112171_a89d89b47e_o.png

Description

iReboot is NeoSmart Technologies' simple yet effective reboot helper tool. iReboot sits in your taskbar at startup (only taking up 400KB of memory!) and lets you choose which operating system you want to reboot into. Instead of pressing restart, waiting for Windows to shut down, waiting for your BIOS to post, then selecting the operating system you want to boot into (within the bootloader time-limit!); you just right-click on the iReboot icon in the taskbar and select the entry you want to boot into from iReboot, and let it do the rest!

glnz

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
  
4wd - Thanks!  Did not know that NeoSmart had made a "lite" version of EasyBCD (which I've never tried).

HOWEVER, does that iReboot do a reboot immediately, or just do the setting for the next reboot?
ALSO, does it work in both Win 7 Pro 64-bit and Win 8 Pro 64-bit?

BUT ... I sure would prefer an easy bat file.

UPDATE - starting in Win 7, my last effort to designate the reboot OS in msconfig caused a BSOD on shutdown, but the machine recovered itself.  I had been playing with the options No GUI, etc., and that seems to have spooked the machine.

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,644
    • View Profile
    • Donate to Member
NOTE: I've updated because I found the correct option  :-[

Otherwise for a command file, all you really need to do is use the bcdedit /default command before you use shutdown.

eg.
Code: Text [Select]
  1. bcdedit /default {0011bdc7-6e99-11e3-a36d-bc5ff437d5b7}
  2. shutdown /r -f -t 20

The number after bcdedit /default refers to the OS identifier in the boot loader, you can find out what it is by doing bcdedit /v.

eg.
2014-11-30 10_52_36.png

Note, you need Admin privileges to run the command file since it plays with the boot loader.

If you felt like it, you could also do some error checking between the bcdedit and shutdown command to make sure the bcdedit didn't fail.  * Pointless, see post below.

To illustrate what should happen, I've entered bcdedit /default {0011bdc7-6e99-11e3-a36d-bc5ff437d5b7} in my CLI - note what it now says against the second entry:

2014-11-30 10_44_49.png

So it'll boot into that entry next time.

Just to make it absolutely clear, the various identifiers will be unique to your system.

I can not help you with writing the command files unless you post the results of bcdedit /v.
« Last Edit: November 29, 2014, 06:06 PM by 4wd »

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,644
    • View Profile
    • Donate to Member
Just to add to my post above:

Make damn sure you get the identifier correct because bcdedit will set it even if it doesn't exist.

This kind of makes error checking on the results of the bcdedit /default pointless - well done MS.

ie. Below I've used a invalid identifier yet the command completed successfully and set it as the default - this will result in a non-booting system.

2014-11-30 11_01_03.png

glnz

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
4wd - This is very educational, and I am very thankful you just posted the warning directly above.  I have just taken my first look at these commands - my start at this level.  By the way - what I see has a few more lines than yours -
  custom three times
  nx
  sos
  etc.

Well, this seems a bit dangerous, no?  Maybe I should try your iReboot suggestion.  UNLESS there's a way to do a bat file that simply repeats my steps A) above (not B which just blew up on me).

I have a lot to learn about Win 7 and 8 before I can feel that I'm back at my level with XP - and even there I was just a dangerous noob.  And just now my playing with msconfig has caused TWO BSDODs on shutdown, which I seem to have corrected with a System Restore to this morning (that says it did not take 100% - oh well).

Many thanks!  It took me six (?) years of fussing with XP to feel confident I could repair blow-ups.  Feels like I'm back at the start.  But this IS a start.

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,644
    • View Profile
    • Donate to Member
Well, this seems a bit dangerous, no?  Maybe I should try your iReboot suggestion.  UNLESS there's a way to do a bat file that simply repeats my steps A) above (not B which just blew up on me).

Post up the output from bcdedit /v and I'll have a look.

Otherwise, in iReboot just select the top option in the menu which will cause it to reboot to your chosen OS after choosing it.

glnz

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
4wd - Unfortunately, the PC with my Win 7 and my Win 8 doesn't have email or network connectivity yet so hard to copy and paste the bcedit /v result - but I will come back here when it's more set up and let you see.

Meantime, I downloaded EasyBCD and I can see how that can do the same thing (I think).

Many thanks.  Really superb info from you.  You will hear from me again fairly soon.