A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. A batch file may contain any command the interpreter accepts interactively and use constructs that enable conditional branching and looping within the batch file, such as IF, FOR, and GOTO labels. The term "batch" is from batch processing, meaning "non-interactive execution", though a batch file might not process a batch of multiple data. Similar to Job Control Language (JCL), DCL and other systems on mainframe and minicomputer systems, batch files were added to ease the work required for certain regular tasks by allowing the user to set up a script to automate them. When a batch file is run, the shell program (usually COMMAND.COM or cmd.exe) reads the file and executes its commands, normally line-by-line. Unix-like operating systems, such as Linux, have a similar, but more flexible, type of file called a shell script. The .bat is used in DOS and Windows. Windows NT and OS/2 also added .cmd. Batch files for other environments may have different extensions, e.g., .btm in 4DOS, 4OS2 and 4NT related shells. The detailed handling of batch files has changed significantly between versions. Some of the detail in this article applies to all batch files, while other details apply only to certain versions. In MS-DOS, a batch file can be started from the command-line interface by typing its name, followed by any required parameters and pressing the key. When DOS loads, the file AUTOEXEC.BAT, when present, is automatically executed, so any commands that need to be run to set up the DOS environment may be placed in this file. Computer users would have the AUTOEXEC.BAT file set up the system date and time, initialize the DOS environment, load any resident programs or device drivers, or initialize network connections and assignments. A .bat file name extension identifies a file containing commands that are executed by the command interpreter COMMAND.

À propos de ce résultat
Cette page est générée automatiquement et peut contenir des informations qui ne sont pas correctes, complètes, à jour ou pertinentes par rapport à votre recherche. Il en va de même pour toutes les autres pages de ce site. Veillez à vérifier les informations auprès des sources officielles de l'EPFL.
Publications associées (17)
Concepts associés (16)
Interface en ligne de commande
vignette|300px|Capture d'écran d'un shell Bash sous Gentoo. Une interface en ligne de commande ou ILC (en anglais command line interface, couramment abrégé CLI) est une interface homme-machine dans laquelle la communication entre l'utilisateur et l'ordinateur s'effectue en mode texte : l'utilisateur tape une ligne de commande, c'est-à-dire du texte au clavier pour demander à l'ordinateur d'effectuer une opération ; l'ordinateur affiche du texte correspondant au résultat de l'exécution des commandes tapées ou à des questions qu'un logiciel pose à l'utilisateur.
Commande DOS
Les systèmes DOS sont fournis en standard avec un nombre réduit de commandes, essentiellement destinées à la gestion des disques et des fichiers (d'où le D pour Disk, ou disque en français). Il existe des commandes internes (contenues dans l'interpréteur) et des commandes externes (il faut les charger à partir d'une disquette). Les commandes DOS peuvent s'exécuter de manière interactive au sein de l'interface en ligne de commande ou en traitement par lot depuis un fichier de script portant l’extension .bat.
Echo (Unix)
En informatique, le terme anglais echo (mot transparent, en français écho) est employé par analogie avec le phénomène acoustique. echo est une commande UNIX (également présente avec MS-DOS) qui permet d'afficher une chaîne de caractères passée en paramètre sur le terminal (sortie standard). Cette commande est fréquemment utilisée dans les scripts shell et les programmes batchs pour indiquer textuellement un état du programme à l'écran ou dans un fichier. $> echo Un petit test. Un petit test.
Afficher plus