How to use .bat file to deal with multiple command line parameters?

This is a discussion on How to use .bat file to deal with multiple command line parameters? within the C++ Programming forums, part of the General Programming Boards category; I just want to run a program in VC 6.0 E.Version, and there are many txt files to be read ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Question How to use .bat file to deal with multiple command line parameters?

    I just want to run a program in VC 6.0 E.Version, and there are many txt files to be read while the program running. My classmate told me that I should use a bat file to pass every paramenter to the program.

    I, now, show a list of part of parameters.

    curve_editor -input spline8_01_bezier.txt -output_bezier output8_01_bezier.txt
    curve_editor -input spline8_01_bezier.txt -output_bspline output8_01_bspline.txt
    curve_editor -input spline8_02_bspline.txt -output_bezier output8_02_bezier.txt
    curve_editor -input spline8_02_bspline.txt -output_bspline output8_02_bspline.txt

    I am very poor in C++ as well as VC6.0, so I ask somebody for help.

    PS: I can use VC to add only one parameter with Menu Project -> settings ...................
    Thanks in advance.
    Last edited by letmoon; 11-16-2008 at 12:06 AM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,546
    A bat file seems fine.
    But you don't need Visual Studio to run it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    If you just want to always run all of those commands in sequence, open Notepad, paste the commands exactly as you have them into it, save it as a .bat file (by choosing All Files instead of Text Files), and you're done.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Print a File on Multiple Processors
    By Cell in forum Linux Programming
    Replies: 6
    Last Post: 03-25-2009, 09:39 AM
  2. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  3. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21