Results 1 to 3 of 3

Thread: argument sintax in batch file

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    u.s.a
    Posts
    127
    Does anyone know the sintax for an argument in a batch file?
    For example:
    If I have a Batch file called MyBatch,and the Batch file has the command to call an exe called MyExe,and MyExe gets one argument: lets say arg1.
    If I call the batch file with an argument what is the sintax to pass the argument on to MyExe?
    If in VB I have the command: shell ("MyBatch arg"), what is written in the Batch file to call MyExe with arg?

    I hope I havent made you crazy.
    Thanks.
    Dan.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I'm not sure, it's been a while since i did batch files

    but i guess you put %1 for the first parameter and %2 for the second...

    MyExe %1
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    Use %1, %2, etc.. i.e.
    Create a Batch file on your desktop using:
    Code:
    @ECHO You Selected %1
    Now drop a file on it.

Posting Permissions

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



Click Here to Expand Forum to Full Width