You are super. This is really great. I found my error. You are 100% correct.
Thank you very much for the great code.
I have discovered in order to repair the boot records I need to run some more commands. I would really like to automate these if I can. If you would like I can start a new thread or we can continue this thread. If we continue this thread when we are done I can post the complete bat file I have with other steps I have taken to repair the boot record.
I have discovered when I run
Bootrec /scanos
If it returns Total identified Windows installations: 0
I need to run some additional code.
The exact output I get is:
C:\Dnload>BOOTREC /SCANOS
S c a n n i n g a l l d i s k s f o r W i n d o w s i n s t a l l a t i o n s .
P l e a s e w a i t , s i n c e t h i s m a y t a k e a w h i l e . . .
S u c c e s s f u l l y s c a n n e d W i n d o w s i n s t a l l a t i o n s .
T o t a l i d e n t i f i e d W i n d o w s i n s t a l l a t i o n s : 0
T h e o p e r a t i o n c o m p l e t e d s u c c e s s f u l l y .
The only time I need to add this code is when number of installations is zero.
If the number is one I don't need to add the code.
The code I need to add is:
:: Beginning of code
bcdedit /export c:\bcdbackup
attrib c:\boot\bcd -h -r -s
ren C:\boot\bcd bcd.old
bootrec /rebuildbcd
:: End of code
Which should produce this in the Command Prompt window:
Scanning all disks for Windows installations.
Please wait, since this may take a while...
Successfully scanned Windows installations.
Total identified Windows installations: 1
[1] D:\Windows
Add installation to boot list? Yes<Y>/No<N>/All<A>:
I think I should choose this manually and it not be automated.
Thank you very much,
Docfxit