What is a batch file?

Last update on April 29, 2009 09:44 AM by netsa77
Published by netsa77

What is a batch file?







Windows comes with a version of DOS, which allows you,exploiting the features and the sequence of commands in a script. Batch file, is a simple text file (ascii) with each line contains commands successively interpreted by DOS.
This file can be launched either from a DOS session or directly, by double clicking from Windows.

Creating a batch file


Prerequisites

  • Uncheck the "Hide file extensions of the type known in the advanced options of Windows Explorer.
  • Use a text editor that saves the file in plain text (not binary).

o Example: ( "Notepad"), "Edit" under DOS

Create file

  • Open your text editor.
  • Enter your command lines.
  • Save your file with a.txt (plain text) and close it.
  • Click once on the file name and then press the F2 key you are in "edit mode".
  • Rename the file by replacing the extension. txt. Bat (or. Cmd for newer OS.
  • When asked: "Are you sure you want to rename the file? The answer is "Yes".
Best answers for « What is a batch file? » in :
Batch file – Get Filenames & Timestamps Show Batch file – Get Filenames & Timestamps Issue Solution Note Issue Can anyone help me create a batch file that will display all the files, subfolders and files under subfolders of folder with both date created and date modified then...
[Batch File]Time based actions Show [Batch File]Time based actions Issue Solution Issue Upon creating a batch file you want that certain line of batch file is executed after every second (not all the program only certain line). In VB we can do it using the Timer...
Batch file ShowBatch file Settings File Creation DOS is integrated in windows which allow to exploit functionality and command sequence in a script. A batch file is a text file which contains command to be read by DOS. This file can be launched...
Renaming multiple files in batch ShowRenaming multiple files in batch Native features Using a third-party program Renaming a large number of files can quickly become tedious. Fortunately, there are tools to automate this task in many cases: Native features On Windows...
Writing in batch in text file ShowWriting in batch in text file To write in a file text, you just have to use a redirect: echo text > output_file.txt To write in an existing file: echo " Write at the end of the file ">> output_file.txt