Help - Search - Members - Calendar
Full Version: bootCheck
The CD Forum > CD Shell and Boot Scriptor > Troubleshooting & Problems
TomSilver
I know another topic had a discussion about this, but I still see no solution.
The bootCheck function does not work.
I tried using it, using this code:

CODE
BOOTHD1:
if !bootCheck[$hda];then print "Drive not bootable";then getkey;then goto BOOT;else boot $hda;

BOOTHD2:
if !bootCheck[$hdb];then print "Drive not bootable";then getkey;then goto BOOT;else boot $hdb;


I try it in MS Virtual PC 5.3 Trial, with an unformatted virtual hard disk.
Both of the scripts will try and run from the HD, resulting in a nice error:
QUOTE
Error: Could not read from the device.
[Command: boot][Line: 78.1] [File: cdshell.ini]


I'd really like to have a solution to this.
ByteCoder
I'm using an older version of CDShell and this works just fine for me.

CODE
Boot_HDD:
cls
if bootCheck[0x80] == 0; then goto BootError
if bootCheck[0x80] == 3; then boot 0x80
goto Menu

Boot_Floppy:
cls
if bootCheck[0x00] == 0; then goto BootError
boot 0x00
goto Menu

BootError:
cls
print "\n\n\n\n"
print c "\c4f                                  \n"
print c "\c4f          CRITICAL ERROR          \n"
print c "\c4f                                  \n"
print "\n\n\n"
print c "\c0BSelected device is not bootable or missing\n\n"
print c "\c0BPress any key to return to main menu.\n"
getkey
goto Menu


This assumes that 'Menu' is the start of your main script file. Hope that helps.
skewltek
I use this with the newest CDshell and it seems to work for me. It's not too different from ByteCoders version.
CODE
BOOTHD:
cls
if bootCheck[0x80] == 0; then goto BOOTHD2
if bootCheck[0x80] == 3; then boot 0x80

BOOTHD2:
if bootCheck[0x81] == 0; then goto BootErr
if bootCheck[0x81] == 3; then boot 0x80

BootErr:
set textColor = color[brightred on black]
print "\n"
print "\acDrive is not bootable\n"
wait 3
script cdshell
TomSilver
Strange...
I use the newest CDShell and I test it using MSVM.
I'll try your exact code.

Thanks for the replies.

EDIT: Yay skewltek, it works!
I found a mistake though: in BOOTHD2, the "boot 0x80" has to be "boot 0x81"
skewltek
@TomSilver
QUOTE
I found a mistake though: in BOOTHD2, the "boot 0x80" has to be "boot 0x81"

good catch... obviously I havent had to boot the D drive. Thanks!
TomSilver
You're welcome ^^
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.