/* 1. Compiler: TC 2.0 2. Mode: Large 3. Project: Runprog.prj Runprog.c ..\lib\8000l.lib ..\lib\tcpipl.lib 4. Explain: To use Ungetch() to run another program. ** Please download hello.exe,hello1.exe,hello2.exe & runprog.exe then run runprog.exe 5. Hordware: 8831 It's compiled by Tony ------------------------------------------------------------------------------------- */ #include #include #include #include #include #include"..\lib\8000.h" #include"..\LIB\vxcomm.h" /*----------------------------------------------------------------------------------*/ void Run(char *cmd) { while(*cmd){ Ungetch(*cmd++); } Ungetch('\r'); } void main(void) { if(!Is8000()){ /*detect the current operation system*/ Print("\nrunprog.exe must run on 8831 with Minios7"); return; } Print("Select a program to run...\n\r"); Print("1:Hello.EXE\n\r"); Print("2:Hello1.EXE\n\r"); Print("3:Hello2.EXE\n\r"); Print("4:dir\n\r"); Print("5:dir /crc\n\r"); Print("others:quit\n\r"); switch(Getch()){ case '1': Run("hello.exe"); break; case '2': Run("hello1.exe"); break; case '3': Run("hello2.exe"); break; case '4': Run("dir"); break; case '5': Run("dir /crc"); break; default: Print("Do not select program to run."); break; } }