#include #include #include void main() { int bootflag=0; char *err[]={"Abandoning control...","Error: Invalid Input\nPress a key to try again..."}; char *bm[]={"Booting with DOS...","Booting with Windows...","Booting with DOS and transferring control to BC.BAT..."}; char *text[]={"BootChoice by Shekhar A. Sherikar\n","*** MENU ***","1. Press F1 to Boot with DOS","2. Press F2 to Boot with WINDOWS","3. Press F3 to Boot with DOS & run commands in file BC.BAT","4. Press ESC to forcefully terminate this program"},ch; while(bootflag==0) { clrscr(); puts(text[0]); puts(text[1]); puts(text[2]); puts(text[3]); puts(text[4]); puts(text[5]); printf("\nEnter your option: "); ch=getch(); if(ch==27) { puts("ESC"); puts(err[0]); exit(0); } if(ch==0) ch=getch(); switch(ch) { case 59:puts("F1"); bootflag=1; break; case 60:puts("F2"); bootflag=2; break; case 61:puts("F3"); bootflag=3; break; default:puts(err[1]); getch(); bootflag=0; break; } } switch(bootflag) { case 1:puts(bm[0]); break; case 2:puts(bm[1]); system("WIN"); break; case 3:puts(bm[2]); system("BC.BAT"); break; } }