echo commands & other query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JOHNSHELL08
    New Member
    • Nov 2008
    • 31

    echo commands & other query

    sir , i saw many batch file which contains the first line
    @ ECHO OFF

    WHAT THIS LINE DOES & WHAT ITS IMPORTANCE IN BATCH FILE.

    AND ALSO TELL ME............. ....

    How can we execute a single command in many time i.e. we want to create 1000 folder named john. then we write this commands md john in any batch file or command prompt in 1000 times. so there is no any method through we make 1000 folder with only single command

    please solve.
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    Hi!
    To find out what that command does, create two files (say test1.bat and test2.bat) with the following contents:
    Code:
    ECHO "This is test1.bat"
    and
    Code:
    @ECHO OFF
    ECHO "This is test2.bat"
    Run both files. Can you spot the difference?

    Now, about the "creating 1000 folders" problem, search for "batch FOR loop" (e.g. on Google) - that should answer your question.

    Greetings,
    Nepomuk

    Comment

    • JOHNSHELL08
      New Member
      • Nov 2008
      • 31

      #3
      no found any positive points

      sir i can not differenceate b/w your two commands ,sir please clears it.

      Comment

      • anijos
        New Member
        • Nov 2008
        • 52

        #4
        Batch files allow MS-DOS and Microsoft Windows users to create a lists of commands to run in sequence once the batch file has been executed. For example, a batch file could be used to run frequently run commands, deleting a series of files, moving files, etc. A simple batch file does not require any special programming skills and can be done by users who have a basic understanding of MS-DOS commands.

        A good example of a batch file for someone who is more familiar with Windows or the MacOS is to think of a batch file as a shortcut in Windows or an icon on the MacOS. Much like a shortcut, batch files could be used to run one or more commands and/or programs through the command line.

        Another example of a very well known batch file is the autoexec.bat, which is a simple boot file loaded each time the computer is loaded on MS-DOS and early Windows computers. This batch file contained all the necessary commands and programs used to run MS-DOS and Windows each time the computer booted.

        Comment

        • anijos
          New Member
          • Nov 2008
          • 52

          #5
          Will display a message in the batch file. Such as ECHO Hello World will print Hello World on the screen when executed. However, without @ECHO OFF at the beginning of the batch file you'll also get "ECHO Hello World" and "Hello World." Finally, if you'd just like to create a blank line, type ECHO. adding the period at the end creates an empty line.

          @:-Does not echo back the text after the at symbol. This is most commonly used as @ECHO OFF to prevent any of the commands in the batch file from being displayed, just the information needed.


          AniJos

          Comment

          • Kvod10
            New Member
            • Nov 2008
            • 7

            #6
            One problem that your going to run into making 1000 folders named "John" is that Windows will only allow one folder titled that per directory.

            Your going to need to find a way to either create them in seperate directories or have them all named differently i.e. "John1", "John2", "John 3", ect...

            If you find a way to do this, please post your final product! I'd love to see what that code would look like in batch

            P.S. I would consider looking into another language in order to do something like that. Many languages, when used on windows, have the ability to call batch commands and can alter the commands and call them again as many times as you allow. Using a language such as C++ or Python would allow you to do a task like this in just a few lines of code

            Comment

            Working...