Étape 4: Vérifier en arrière
À ce stade, vous devriez ont appris comment :
Créer des paramètres de base de traitement par lots
Créez une variable d’environnementale
Mettre en place une commande
Réinitialiser après chaque commande
Personnaliser la sortie de commande
À l’aide de tout ce que vous avez appris, faire un jeu de commandes et également une commande d’aide expliquant ce que chacune de vos commandes personnalisées. Lorsque vous avez terminé, il devrait ressembler à ceci :
<p> off<br>color a :start cls :nonclear title butler echo hello, how can I help you?</p><p>set /p main=">" </p><p>if '%main%' == 'steam' goto steam if '%main%' == 'exit' goto exit if '%main%' == 'logoff' goto logoff if '%main%' == 'shutdown' goto shutdown if '%main%' == 'help' goto help if '%main%' == 'instructables' goto instructables if '%main%' == 'color' goto color</p><p>:steam<br>cd C:\Program Files (x86)\steam\ start Steam.exe pause goto start</p><p>:exit<br>exit</p><p>:logoff</p><p>echo log off?</p><p>set /p logyn=">" if '%logyn%' == 'yes' goto logy if '%logyn%' == 'no' goto start goto start</p><p>:logy shutdown -l</p><p>:shutdown echo Shut down? set /p shutyn=">" if '%shutyn%' == 'yes' goto shuty if '%shutyn%' == 'no' goto start pause goto start</p><p>:shuty shutdown /p</p><p>:help<br> echo exit - closes this window echo. echo help - displays this menu echo. echo logoff - logs off this user echo. echo shutdown - shuts down the computer echo. echo steam - opens steam</p><p>echo.</p><p>echo instructables - opens the instructables homepage</p><p>echo.</p><p>echo color - Color customization</p><p>pause</p><p>goto start</p><p>:color<br>cls echo type back to return echo What color would you like the text to be? echo type list for a list of colors</p><p>set /p color=">"</p><p>if '%color%' == 'list' goto list if '%color%' == 'blue' goto color_blue if '%color%' == 'gray' goto color_gray if '%color%' == 'green' goto color_green if '%color%' == 'aqua' goto color_aqua if '%color%' == 'red' goto color_red if '%color%' == 'purple' goto color_purple if '%color%' == 'yellow' goto color_yellow if '%color%' == 'white' goto color_white if '%color%' == 'back' goto back</p><p>:list cls echo blue echo gray echo green echo aqua echo red echo purple echo yellow echo white pause goto :color</p><p>:color_blue color 9 pause goto start</p><p>:color_gray color 8 pause goto start</p><p>:color_green color a pause goto start</p><p>:color_aqua color b pause goto start</p><p>:color_red color c pause goto start</p><p>:color_purple color d pause goto start</p><p>:color_yellow color e pause goto start</p><p>:color_white color f pause goto start</p>