Home / Microsoft / Microsoft DOS / Help with bat file for Vista reboot-Update-SOLVED
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2  All - (Bottom) Print
Author Topic: Help with bat file for Vista reboot-Update-SOLVED  (Read 9193 times)
matnat
Topic Starter
Greenhorn



Posts: 9


« on: January 29, 2008, 06:38:00 AM »

I am running a dual boot system. Vista Home Premium and XP SP2. Vista is set to be the default OS in my vista bootloader. My timeout is 3 seconds for OS choice.

I am looking to have a bat file on my Vista desktop that reboots the system and specifies on reboot to choose the XP OS.  This way I can reboot to the other OS unattended.

Any ideas on this?

Scroll down to find my answer to this problem.
« Last Edit: January 30, 2008, 01:20:07 AM by matnat » IP logged
Eg0Death
Apprentice



Posts: 431


« Reply #1 on: January 29, 2008, 10:58:54 AM »

I'm looking for the same thing!
IP logged

Why is this thus?  What is the reason for this thusness?
WillyW
Mentor



Thanked: 26
Posts: 1,819

Experience: Experienced
OS: Windows XP



« Reply #2 on: January 29, 2008, 11:19:14 AM »

... Vista is set to be the default OS in my vista bootloader. ...

I don't have XP or Vista, but I see you haven't gotten any other replies yet.
:)

Curious -  is the bootloader controlled by a configuration file?
boot.ini   perhaps?      and is that everything that controls that part of the boot process?

I'm thinking that if it is, then you could create another such file.   One for both scenarios.
Then, with some batch file copy/rename manipulation,   you could reduce the  steps of switching them to simply running a batch file..... and that sounds like what you want to do.

Quote
I am looking to have a bat file on my Vista desktop that reboots the system ...

For this part,  we'd need to look for the command that would reboot the system.      A quick google finds:   http://www.tech-recipes.com/windows_tips84.html
Check it out carefully -  does that apply?
Also see:   http://www.computerhope.com/shutdown.htm

IP logged

.


matnat
Topic Starter
Greenhorn



Posts: 9


« Reply #3 on: January 29, 2008, 04:09:44 PM »

I was thinking along those same lines.. ie renaming the config files as you describe. Unfortunately the Vista bootloader is designed around a different operating principle than the XP bootloader is. There is no boot.ini. I haven't toyed with the guts of the Vista bootloader enough as yet to understand if this is even an option.  I do believe that the Vista bootloader requires that multiples files be modified to achieve what was once a simple mod of the XP bootloader. Anyone with in depth experience with the vista bootloader out there??

I am thinking that if this can be done a separate batch file will need to be put on each OS. The vista .bat switches the default OS to XP and the XP .bat switches the default to Vista. Probably should keep the OS timeout choice above 2 or 3 seconds just so you do have the option to choose from a cold boot.

As for the rest of the restart commands that's pretty straight forward unless Vista has some other surprises in store. I will check into this a post accordingly.

IP logged
WillyW
Mentor



Thanked: 26
Posts: 1,819

Experience: Experienced
OS: Windows XP



« Reply #4 on: January 29, 2008, 04:51:01 PM »

Wait a while, and see what replies you get from anyone that is familiar with Vista.

But, here's something to keep in the back of your mind for later:
How do the Linux people do it?     ;)
They would use Grub or Lilo as a bootloader?       Somehow, it would have to load Vista.     
Therein might be a work-around solution.    If you learn how to use one of those boot loaders, and if one of them uses a config file that you can switch around -  you're in business.
Again, it is just something that came to mind, and you would need to research it.   Just wanted to mention the possibility.

IP logged

.


matnat
Topic Starter
Greenhorn



Posts: 9


« Reply #5 on: January 29, 2008, 05:17:23 PM »

Thats good advice and I think I will follow it for now. Don't wanna find myself looking at an NTLDR error or something worse after messing with my boot files  :-\
IP logged
WillyW
Mentor



Thanked: 26
Posts: 1,819

Experience: Experienced
OS: Windows XP



« Reply #6 on: January 29, 2008, 05:29:41 PM »

Just noticed - -   these are your first posts here on Computer Hope.


Welcome to CH!       :D
IP logged

.


matnat
Topic Starter
Greenhorn



Posts: 9


« Reply #7 on: January 29, 2008, 09:47:35 PM »

This is how I achieved my goal.

Caution be very carefull, messing with your mbr and bcd store is dangerous and could cause your system not to boot at all, thus leading to more pain and suffering, proceed with caution.

First you have to understand how to make windows reboot with a bat file.

XP   shutdown -r -t 00 (this tells xp to reboot with 00 delay) basic stuff


Vista= download the wizmo program below and setup the command to reboot. You end up with the wizmo.exe and a shortcut with the switch wizmo.exe reboot. fairly easy to do, follow the directions. I put wizmo in the root of my c:\ just to keep it out of the way.

http://www.grc.com/files/wizmo.exe


Next, you need to be able to identify the "GUID" of your vista install and your XP install. XP is always identified as follows {ntldr}. IF you have vistabootpro then the next part is easy, if you don't have it, then get it. vistabootpro is a nice program to have, you may need to update portions of your system to get it to run. It will tell you if your lacking anything.

here -> http://www.vistabootpro.org/track/click.php?id=2

From vistabootpro change your default OS to windows XP.
Now, from a command prompt run bcdedit. If you are currently in XP you may need to copy the bcdedit.exe from your vista windows\system32 folder to the like folder in XP.

The output from BCDEDIT will have the category "windows boot manager", in this list is the "default" category. You should see {ntldr} take note of this location, you will come back to it. Next go back to Vistabootpro and change your default OS to vista. Rerun BCDEDIT and look at the default line now. it should have the string value of your GUID for vista. It looks something like this {84dd5819-b823-12ef-b2f0-444512344200} write yours down. This is not a universal number,all machines are unique and this is one i made up.  :'(

once you have this info do the following.

create a .bat file in Vista with the following commands in it. This is for the switch to XP.

bcdedit /default {ntldr}
C:\wizmo.exe reboot

This changes the default os to XP {ntldr} and then tells the system to restart.


create a bat file in XP with the following commands in it. This is for the switch to Vista.


bcdedit /default {84aa1239-a823-11aa-b2f0-444123200}
shutdown -r -t 00

This does the same thing only differently. I use the same bcdedit /default command to change the default os in the vista bootloader, however I can use the simpler xp shutdown command instead of wizmo. I chose to go with a delay of 00 since if I didn't use the -t switch I got a 30 second delay by default (*censored*).

Now I have two nifty shortcuts, one on my XP desktop, the other on vista. Both have custom icons and force immediate shutdown and switch to the other OS.

Hope this helps anyone who came up with the same question I did.



 :) :)
IP logged
Eg0Death
Apprentice



Posts: 431


« Reply #8 on: January 30, 2008, 04:58:12 AM »

Sweeeet! :D
 
IP logged

Why is this thus?  What is the reason for this thusness?
WillyW
Mentor



Thanked: 26
Posts: 1,819

Experience: Experienced
OS: Windows XP



« Reply #9 on: January 30, 2008, 10:59:30 AM »

This is how I achieved my goal.
....

Thank you for posting back,  and with such detail.     That is very nice for anyone else that comes along in the future, using the Search functions and finds this thread. 

Quote from: WillyW
...anyone that is familiar with Vista.

Tag!     You're it!!       ;D



Visit with us here often.      ;)
IP logged

.


matnat
Topic Starter
Greenhorn



Posts: 9


« Reply #10 on: January 30, 2008, 02:24:40 PM »

Well, that's why I love forums. In most cases they are a best source of information for hard to find answers.

Enjoy.
IP logged
WillyW
Mentor



Thanked: 26
Posts: 1,819

Experience: Experienced
OS: Windows XP



« Reply #11 on: February 02, 2008, 11:56:55 AM »

I stumbled upon some interesting reading, for which I'll list some links.

Yes,  forums are great,    -   One thing leads to another.     While reading an informative post by a knowledgable member here - soybean -  I saw a link posted.   Followed it,  then looked around there a bit.   Saw some things that reminded me of this thread.   :)

These links are related info to your topic, and just might be useful to anyone that finds this thread:


The definitive dual-booting guide: Linux, Vista and XP step-by-step

How to dual-boot XP and Vista(with XP installed first)  step-by-step guide with screenshots

How to dual-boot Vista and XP(with Vista installed first)

How to dual-boot Linux and XP(with Linux installed first)

How to dual-boot XP and Linux(with XP installed first)

How to dual-boot Vista and Linux(with Linux installed first)

How to dual-boot Vista and Linux(with Vista installed first)

Why Vista's such a pain to dual-boot

How Vista screws dual-booting nirvana


Preparing for dual-booting by doing an image-based backup
"Tutorial summary: We'll create a Windows PreInstalled Environment disk with BartPE Builder, and use the DriveImage XML plugin for BartPE to do the backing up and restoring."


Interesting stuff.     ;)
IP logged

.


Eg0Death
Apprentice



Posts: 431


« Reply #12 on: February 02, 2008, 12:04:20 PM »

Wow!  That's like pr0n for g33ks!
IP logged

Why is this thus?  What is the reason for this thusness?
patio
Moderator
Genius



Thanked: 1026
Posts: 10,685

Experience: Beginner
OS: Windows 7


Maud' Dib

« Reply #13 on: February 02, 2008, 04:57:50 PM »

Pretty convoluted way to get things done since VistaBoot Pro will do it but Congratulations...
IP logged

   
"
All generalizations are false, including this one.  "
WillyW
Mentor



Thanked: 26
Posts: 1,819

Experience: Experienced
OS: Windows XP



« Reply #14 on: February 02, 2008, 05:17:52 PM »

Pretty convoluted way to get things done since VistaBoot Pro will do it but Congratulations...

Any preference vs.  Easy BCD ?
IP logged

.


Pages: [1] 2  All - (Top) Print 
Home / Microsoft / Microsoft DOS / Help with bat file for Vista reboot-Update-SOLVED « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.21 seconds with 23 queries.