6.338 bytes

Service Hints & Tips

Document ID: DJON-3FZK5A

Aptiva - Using batch files to work productively

Applicable to: United States

Using batch files will allow you to work smarter and faster. Batch processing allows users and computers to work together for greater productivity. Routine tasks can be put together in a batch file so that many tasks are fed to the computer after the user starts the batch file rather than the user giving each command separately. The batch gives the computer one command after another instead of the user giving one command, waiting for the system to finish the task, then giving a second command and so on. In other words, the batch file does the work while the user can sit back and let the system go. Batch files are available in DOS for user convenience. After seeing how they work, you will probably find them quite useful.

A batch file is an ASCII (text) file consisting of a series of DOS commands. Most commands appear just as you would type them at a DOS prompt. You can use DOS batch subcommands to further perfect batch files. There are many ways to create batch files:

- Use the Works Word Processor and save the document with a "Text" format and a .BAT extension,

- Use the DOS COPY CON command, or

- Use the MS-DOS EDIT or PC-DOS E editor.

The first and third method are the easiest. A simple example of a batch file is a file that gives the user the directory of the root directory of the C drive and a diskette in A drive at the same time. If you didn't use a batch file, you could do this by typing DIR C:\ and pressing ENTER at a DOS prompt, then typing DIR A:\ and pressing ENTER. If you create a batch file with both of these commands, you could double-click on the batch file name in the DOSSHELL and accomplish the same thing. The batch file, created in the Works Word Processor would have two lines:

DIR C:\

DIR A:\

The file could be saved as C:\DIR_C&A.BAT with a "text" format. After creating it, anytime you wanted a directory of both C and A, you'd just double-click on DIR_C&A in the DOSSHELL. Typing DIR C:\ or DIR A:\ and waiting for a directory to list doesn't take that much time, so this isn't a big time saver -- it is just an example of how a batch file works.

Another way batch files can be used to increase the use of a computer is by creating different AUTOEXEC.BAT files (a very important batch file read every time a computer is turned on) on boot diskettes. Doing this allows a user to start their system one way with one boot diskette and another way with a different boot diskette. This can be carried a step further using a batch file, possibly named REBOOT.BAT, on a fixed disk that will take a variable given by the user to start a computer up using different AUTOEXEC files all saved on the fixed disk with different extensions. An experienced DOS user could write such a batch file. There are programs available, however, that do this without the user having to know how to write a batch program. The program allows you to give the batch program a certain variable. The batch file then "reboots" your computer using different AUTOEXEC files.

These are just a few of the great uses of batch files. For more information on batch files, you may want to check out a book on DOS at a local library or book store. Most books written about DOS devote whole chapters to batch file use and creation.

Search Keywords

DOS

Hint Category

DOS/Windows 3.x

Date Created

10-04-97

Last Updated

15-03-99

Revision Date

15-03-2000

Brand

IBM Aptiva

Product Family

Aptiva, PS/1

Machine Type

2011, 2134, 2144, 2159, 2168, 2176, 2121, 2123, 2133, 2155

Model

6R6; C21; C31; C32; 6R9; C31; F31; C6D; 8R6; 8R9; 9R4; 6R8; 7R1; 7R3; 7R6; 7R7; 7R9; 7RO; 8R1; 8R8; 9R2; 9R3; C23; C33; C35; C55; C56; C65; C66; C67; C6V; C6Y; C6Z; C73; C76; C77; F23; F33; F35; F67; 5R5; M91; 2R5; 2R7; 2R8; M30; M35; M50; 2R6; 4R7; 4R8; M40; M54; M58; 3R0; 3R8; M60; M70; 3R4; 3R6; 4R1; 4R9; M31; M51; M52; M63; 2R9; 3R1; 3R3; 3R5; 3R7; 3R9; 4R0; 4R2; 4R3; M41; M53; M55; M56; M57; M61; M62; M71; M72; 5R1; 6R3; A10; A12; A14; 5R2; 5R3; 5R6; 5R8; 5R9; 6R0; 6R4; 6R5; A15; A40; A44; A45; A50; A51; A52; A90; A92; A94; 1R2; 66P; 67P; 86P; OR8; 1R1; 1R3; 1R5; 22P; 24P; 25P; 27P; 29P; 63P; 67P; 82P; 83P; OR6; OR7; OR9; 1R0; 1R1; 26P; 62P; 2R0; P30; C01; C34; M01; NEA; T35; U35; A62; A82; A94; B82; C42; C92; G42; M82; S92; 081; 087; 131; 137; K37; N31; N81; 11E; 13T; 14C; 16E; 17A; 18A; 18T; 19C; 21C; 23C; 28A; 46M; 51D; D50; G11; G13; G43; G46; G46; G49; G49; G50; G53; M40; M40; M46; M46; P11; P13; P43; P50; P53; R04; R05; R06; R09; R38; R42; R43; R44; R84; R86; R87; RO3; S11; S13; S43; S45; S45; S47; S47; S48; S48; S50; S53; W11; W13; W42; W42; W43; W45; W45; W50; W53; 20E; 22T; 24C; 24M; 28V; 39E; 41T; 43C; 45V; 48E; 50T; 52C; 55V; 72E; 74T; 76C; 78C; 79C; 81A; 82E; 84T; 86C; 87C; CC1; D53; G14; G44; G52; G54; G72; G76; G78; G82; NM1; P14; P44; P57; P71; P74; P76; P78; P84; R14; R15; R16; R17; R18; R51; R52; R57; R58; R62; R63; R67; R71; R89; R93; R96; R97; S14; S44; S50; S54; S70; S75; S76; S78; S80; W14; W44; W48; W54; W67; W76; W77; W78; Z33; 28V; 31E; 33T; 37C; 38C; 51E; 54T; 56C; 57C; 88V; BB1; G57; G87; OR1; OR3; OR4; OR5; P89; R28; R29; R31; R74; R78; R82; R98; S55; S85; SR1; US1; W52; W82; S64; S66; S74; S7H; S78; S80; S90; 2R3; S15

TypeModel

20116R6

Retain Tip (if applicable)

Reverse Doclinks
and Admin Purposes