Little Bit & Bytes Of Batch File Programming.
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Little Bit & Bytes Of Batch File Programming.

  1. #1
    Member
    Join Date
    Mar 2003
    Posts
    74

    Lightbulb Little Bit & Bytes Of Batch File Programming.

    ++++++++++++++++++++++++++++++++++++++++++++++++++
    ________________________________________________________

    "Batch File Programming"
    Level:Starter
    AUTOR: RITESH GAUR


    --------------------------------------------------------------------------------
    1:{)What are batch files?

    --------------------------------------------------------------------------------
    Any file with the extension of .bat
    These file are use to perform number of task one by one,well this is the original idea,infact it was when multitasking was not posible or expensive.
    Old days systems are not well capable to do things as faster than today, you may be sitting in fast processor based computer but those days fast means just a little faster than your sci.caluator.
    Whenever they want to do things they usally create batch file in which they may place commands to perform the task by computer.like u may love to do this
    1dir
    2dir/w
    3dir/s
    see what will happen,if ur system has lots of file than u may impress your girlfriend to inform her that you computer has a virus and u love to see that.
    Well back to the topic those guys commands big jobs once and try to do other small or imp. work.like they may love to created file such as:
    del *.tmp
    del *.bak
    del *.obj
    del *.txt
    copy *.data file to tapedrive
    del *.data
    this second last command will take log time(more than hrs if file is long,usally yes),and they don't want to sit in front of computer to watch whats going on during copy command,and then delete the data files.


    --------------------------------------------------------------------------------
    2:{*)How can I create one?

    --------------------------------------------------------------------------------
    just add few commands and save as.bat
    u may use any textfile editor like notepad(MSWindows)or edit filename.bat(DOS)
    3 :{ Any example?
    dir
    dir/w
    dir/s
    dir/p

    --------------------------------------------------------------------------------
    3:{ How can I use batch file to help me?

    --------------------------------------------------------------------------------
    In number of ways.
    If u ur using DOS,then its the best tool.
    How many times u type Dir?
    How do you delete all temp and BAK file in one shot?
    Answer is batch files.
    If u are not using DO,but using sortware that creates numbers of tmp and/or BAK file(e.g-TC/TC++).
    Answer is same.


    --------------------------------------------------------------------------------
    4:{ I know initial level of batch programming that u explained ,I want more is there any more in Batch programming,in short tell me about serios commands?

    --------------------------------------------------------------------------------
    A) "ECHO"
    @ECHO OFF
    ECHO "THIS TEXT WILL BE DISPLAY ON SCREEN WITHOUT ECHO WORLD"
    ECHO ON
    ECHO "THIS TEXT WILL BE DISPLAY ON SCREEN WITH ECHO WORLD"

    B)"PAUSE"
    @ECHO OFF
    ECHO EXAMPLE OF PAUSE
    ECHO PAUSE STARTED....
    PAUSE DIR DIR/w ECHO .
    ECHO ..
    PAUSE
    PAUSE
    DIR/sx PAUSE
    DIR
    ECHO PAUSE ENDED.
    C)%1,%2,%3,.....
    Try this
    create a file "tstpara.bat"
    @echo off
    echo first parameter u enter is =%1
    echo second parameter u enter is =%2
    ....
    Now,at command prompt run type this
    tatpara hello ritesh
    chech the respose from file and learn:=)


    --------------------------------------------------------------------------------
    AUTHOR: RITESH GAUR.INDIA
    URL:http://riteshgaur.itgo.com


    --------------------------------------------------------------------------------
    webaddress:riteshgaur@yahoo.com

  2. #2
    Member
    Join Date
    Mar 2003
    Posts
    74

    Lightbulb Little Bit & Bytes Of Batch File Programming.

    ++++++++++++++++++++++++++++++++++++++++++++++++++
    ________________________________________________________

    "Batch File Programming"
    Level:Starter
    AUTOR: RITESH GAUR


    --------------------------------------------------------------------------------
    1:{)What are batch files?

    --------------------------------------------------------------------------------
    Any file with the extension of .bat
    These file are use to perform number of task one by one,well this is the original idea,infact it was when multitasking was not posible or expensive.
    Old days systems are not well capable to do things as faster than today, you may be sitting in fast processor based computer but those days fast means just a little faster than your sci.caluator.
    Whenever they want to do things they usally create batch file in which they may place commands to perform the task by computer.like u may love to do this
    1dir
    2dir/w
    3dir/s
    see what will happen,if ur system has lots of file than u may impress your girlfriend to inform her that you computer has a virus and u love to see that.
    Well back to the topic those guys commands big jobs once and try to do other small or imp. work.like they may love to created file such as:
    del *.tmp
    del *.bak
    del *.obj
    del *.txt
    copy *.data file to tapedrive
    del *.data
    this second last command will take log time(more than hrs if file is long,usally yes),and they don't want to sit in front of computer to watch whats going on during copy command,and then delete the data files.


    --------------------------------------------------------------------------------
    2:{*)How can I create one?

    --------------------------------------------------------------------------------
    just add few commands and save as.bat
    u may use any textfile editor like notepad(MSWindows)or edit filename.bat(DOS)
    3 :{ Any example?
    dir
    dir/w
    dir/s
    dir/p

    --------------------------------------------------------------------------------
    3:{ How can I use batch file to help me?

    --------------------------------------------------------------------------------
    In number of ways.
    If u ur using DOS,then its the best tool.
    How many times u type Dir?
    How do you delete all temp and BAK file in one shot?
    Answer is batch files.
    If u are not using DO,but using sortware that creates numbers of tmp and/or BAK file(e.g-TC/TC++).
    Answer is same.


    --------------------------------------------------------------------------------
    4:{ I know initial level of batch programming that u explained ,I want more is there any more in Batch programming,in short tell me about serios commands?

    --------------------------------------------------------------------------------
    A) "ECHO"
    @ECHO OFF
    ECHO "THIS TEXT WILL BE DISPLAY ON SCREEN WITHOUT ECHO WORLD"
    ECHO ON
    ECHO "THIS TEXT WILL BE DISPLAY ON SCREEN WITH ECHO WORLD"

    B)"PAUSE"
    @ECHO OFF
    ECHO EXAMPLE OF PAUSE
    ECHO PAUSE STARTED....
    PAUSE DIR DIR/w ECHO .
    ECHO ..
    PAUSE
    PAUSE
    DIR/sx PAUSE
    DIR
    ECHO PAUSE ENDED.
    C)%1,%2,%3,.....
    Try this
    create a file "tstpara.bat"
    @echo off
    echo first parameter u enter is =%1
    echo second parameter u enter is =%2
    ....
    Now,at command prompt run type this
    tatpara hello ritesh
    chech the respose from file and learn:=)


    --------------------------------------------------------------------------------
    AUTHOR: RITESH GAUR.INDIA
    URL:http://riteshgaur.itgo.com


    --------------------------------------------------------------------------------
    webaddress:riteshgaur@yahoo.com

  3. #3
    Senior Member
    Join Date
    Jul 2002
    Posts
    744
    Every now and then, one of you won't annoy me.

  4. #4
    Senior Member
    Join Date
    Jul 2002
    Posts
    744
    Every now and then, one of you won't annoy me.

  5. #5
    Junior Member
    Join Date
    Mar 2003
    Posts
    7

    Thumbs down Get A Grip!

    GIVE ME A BREAK! We are discussing batch file programming, with all the interesting new technologies available you are talking about batch files. Come On
    New World Order!

  6. #6
    Junior Member
    Join Date
    Mar 2003
    Posts
    7

    Thumbs down Get A Grip!

    GIVE ME A BREAK! We are discussing batch file programming, with all the interesting new technologies available you are talking about batch files. Come On
    New World Order!

  7. #7
    Member
    Join Date
    Sep 2002
    Posts
    77
    Batch files do still have their place in modern IT. Granted there are better 'languages' to achieve purpose of a batch file, but they aren't anywhere as quick to produce a simple 'program' to achieve a simple task.

    For example, say you wanted to clear your temp directory at startup on a 9x system. You could use a proper programming language, such as C++, but this would require compiling it into something that is 16 bit compatible. And of course you also need to know the fairly complex syntax of C++ in order to do it. Using a batch file, it would take you all of about 30 seconds to write it. This is why batch files are still relevant.
    \"Death is more universal than life; everyone dies but not everyone lives.\"
    A. Sachs

  8. #8
    Member
    Join Date
    Sep 2002
    Posts
    77
    Batch files do still have their place in modern IT. Granted there are better 'languages' to achieve purpose of a batch file, but they aren't anywhere as quick to produce a simple 'program' to achieve a simple task.

    For example, say you wanted to clear your temp directory at startup on a 9x system. You could use a proper programming language, such as C++, but this would require compiling it into something that is 16 bit compatible. And of course you also need to know the fairly complex syntax of C++ in order to do it. Using a batch file, it would take you all of about 30 seconds to write it. This is why batch files are still relevant.
    \"Death is more universal than life; everyone dies but not everyone lives.\"
    A. Sachs

  9. #9
    batch files are cool! i made one that would only let you start my comp if you had inserted the key disk... it was lame but at least it kept my family off my comp!!
    THEprophetMOSES

  10. #10
    batch files are cool! i made one that would only let you start my comp if you had inserted the key disk... it was lame but at least it kept my family off my comp!!
    THEprophetMOSES

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •