D3) Menu

La technique est de créer un MENU.BAT qui affiche les choix possibles.

Chacun ces choix correspond à un batch qui ramènera au menu. L'AUTOEXEC.BAT crée un copie du path dans une variable.

AUTOEXEC.BAT 1 ............ ............... . Path c:bat;c:dos;..... . set stdpath=%path% ...............

MENU.DOC 1 MENU 2 TP Turbo pascal 3 3 W Word 3

On peut décorer MENU.DOC avec des codes ESC[XXm pour mettre des couleurs, moyennant chargement de l'ANSI.SYS. Pour créer un caractère ESC, on peut essayer CLS > ESC.DOC puis on édite ESC.DOC... MENU.BAT

1 @echo off

2 cls

3 c:

4 cd

5 type c:batmenu.bat

TP.BAT

1 @echo off

2 cls

3 set path=c:tp;c:tpbin;%path%

4 cd travailpas

5 c:tpturbo %1 %2 %3 %4 %5

6 set path=%stdpath%

7 menu

W.BAT

1 @echo off

2 cls

3 set path=c:word;%path%

4 cd travaildoc

5 c:wordword %1 %2 %3 %4 %5

6 set path=%stdpath%

7 menu

Là encore, ça peut servir à des établissements scolaires fauchés (ou à des PME/PMI dans le même état)