Results 1 to 5 of 5

Thread: Viewing messages with a batch file

  1. #1
    Join Date
    Sep 2010
    Posts
    59

    Viewing messages with a batch file

    If MS-DOS should display a message that you use in your batch program echo command, like this example:
    echo text files are saved to drive A
    to prevent MS-DOS displays commands as they are running, use the following command:
    echo off
    You can insert messages into a batch program so that you will be prompted to enter additional information or recalls a special batch program from the task performed. If MS-DOS should display a message on your screen, use the echo command. For example, the following command tells MS-DOS "Insert a floppy disk in drive A," the message, type:
    echo A disk in drive A, insert
    In a network environment, your message will be displayed more quickly if you paste it into a .Txt file and type in the batch program use the command to display the message. MS-DOS displays this message on the screen. If the message type is to be moved by a certain number of spaces to the right, you need the spaces as part of the message. If the message is displayed on the screen, for example, centered, add the necessary spaces to the command:
    echo A disk in drive A, insert
    If you want to skip a line, type echo after a dot:
    echo.

  2. #2
    Join Date
    Sep 2010
    Posts
    59

    Re: Viewing messages with a batch file

    If echo is turned on, MS-DOS commands from the batch program during its execution. Therefore ("Insert a disk in drive A") the message from the previous example is shown twice: the first time at the command prompt as part of the batch command, and the second time in the form of a command prompt as a result of the command. Thus, a message appears only once, you must ensure that commands are displayed at the command prompt and enter the following command for this purpose:
    echo off
    An example: You could at the beginning of the file described in the previous section SAVE.BAT add the command echo off:
    echo off

    copy c: \ recipes \ crab \ *- doc a: copy c: \ reports \ January \ bak *- a: cls
    This batch program saves the information in two lists of files with a .Doc and .BAK clears the screen and displays the directory listings at a time. Commands that are listed after the first command (echo off) will not be displayed during the execution of the batch program. The line of text that is after the second echo command is, however, appear. This notice will not see a single command in your batch program, enter the command before the @ sign. For example, to display the echo command to prevent off, type @ echo off.When commands are displayed, use the beginning of the batch program this command:
    echo on

  3. #3
    Join Date
    Sep 2010
    Posts
    66

    Using the replaceable parameter $ *

    You can use the replaceable parameter $ * to all of the text of the command to start a macro, followed by, a single parameter assign. Usually, different MS-DOS parameters by a space looking for. The text between the first two spaces is the first parameter, the text between the second and third spaces, the second parameter and so on. If you use the replaceable parameter $ * but passes Doskey space and has all the text to the parameter $ * to. The parameter $ * is particularly useful if the created macro variable number of parameters used one. You can, for example, the following command to create a macro called d, the abbreviation of the command will allow you to:
    doskey d = dir $ *
    Regardless of the number of parameters specified macro does this as well as the dir command. All the following commands for example, the macro d just like using the command you run with:
    .. TXT

    *. Txt / s

    .. TXT / s / b
    If the macro parameter $ 1 instead of $ * to use, replace MS-DOS, the first parameter and passes the rest of the command line.

  4. #4
    Join Date
    Sep 2010
    Posts
    48

    Working with Batch Programs

    While working with MS-DOS, you will find that you need to enter commands always follow the same. You could, for example, always enter the same three commands to change the current drive to, to change the current directory and then start a program. If you are using MS-DOS, you can in a batch program or a batch file save commands. Rather then enter the commands individually, you need the name of the batch program is type. In response, these MS-DOS "batch" of commands from the same as if you had typed individually, the keyboard on it. A batch program is a plain text file containing one or more MS-DOS commands. For example, a batch program example, the commands have to, that you change the directory and start a text editor. Suppose, for example, use the following commands to disk backup copies of files to create one at:
    cd \ word \ textdat copy *- doc a:

    cd \ reports \ XDAT

    *- doc copy a:
    these four commands in a batch program sum up, save it in a plain text file and have the file extension. BAT to. Then you can always, if you want to back up your files, the command prompt, type the name of the batch program to enter. Using batch programs has the following advantages:
    • batch processing programs to accelerate your work. If you run a program of this kind, you need only a single command instead of multiple commands notice. You do not need to enter multiple commands again and again or look up commands to which you can no longer remember.
    • batch processing programs to fit MS-DOS on an individual basis. Using batch programs, you can create your own command lists that are automatically executed then. You can also customize your own needs and messages prompts.

  5. #5
    Join Date
    Jul 2010
    Posts
    75

    How to create a batch file

    With you can copy the command batch program directly from the keyboard to create a. For example: You want to create a batch program that your floppy drive with high storage density, a 360 KB floppy disk formatted. To create this file and call them to MEINFMT.BAT, use the following copy command:
    copy con c: \ meinfmt.BAT
    MS-DOS moves the cursor to the next line. At this time the file is empty. In order desired format command to add the file, type the following:
    format a: / f: 360
    You can now close the file and to MS-DOS prompt return. Do this, press CTRL + Z and then ENTER. Once you have created the batch program, you need only enter its name to floppy disk drive with high storage density, a 360 KB floppy disk to format in your:
    meinfmt
    MS-DOS displays the format command on the screen and prompts you to insert a disk into drive A. (Make sure that the batch file in the current directory or the directory is included in the command search path.) The next batch program, SAVE, is also short enough to create the command to copy with.
    copy con c: \ secure-baf
    This program ensures all in two directories on a hard drive or stored on DOC. And BAK files on a floppy disk and then displays a list of backed up files on the disk:
    copy c: \ books \ hack \ *- doc a: copy c: \ reports \ January \ bak *- a: dir a:

Similar Threads

  1. make file name list in excel using batch file
    By shibinpanayi in forum Windows Software
    Replies: 1
    Last Post: 04-06-2011, 03:44 AM
  2. Windows Batch file to output directory names and size to txt file
    By m2thearkus in forum Software Development
    Replies: 6
    Last Post: 16-07-2010, 12:04 AM
  3. Viewing large file
    By Beryl in forum Windows Software
    Replies: 4
    Last Post: 27-05-2010, 05:58 PM
  4. Dos batch file to sort files based on file names.
    By Jon Osborn in forum Windows Server Help
    Replies: 9
    Last Post: 17-06-2009, 11:06 AM
  5. Replies: 3
    Last Post: 12-03-2009, 12:56 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,000,609.45561 seconds with 17 queries