Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173

    problem passing arguments to a batch file

    Hi

    I am having hard time figuring out how to do the following thing. I have a batch file that i am firing from AMS5 and need to pass 4 arguments to the batch file. Lets say i got the following variables:


    exePath = "C:\\test\\test.exe"
    arg1 = "PC1";
    arg2 = "PC2";
    arg3 = "account";

    and my batch file is called "toto.bat".

    batch file content is: %1 %2 %3 %4 (simple isnt it!)
    From AMS, i need to fire up toto.bat passing it the 4 arguments (variables) showed above so it give something like:

    C:\test\test.exe "PC1" "PC2" account

    (note that arg1 and arg2 must be passed quoted)


    I tried to use the file run action and pass the 4 arguments within the action but i am always getting compile error!! then i tried concatenating the 4 args into a single string to be passed as a single arg to my batch but....no luck...

    i know i am missing something here, i would appreciate if any of you could help me out with that!

    thanks in advance

    Mt

  2. #2
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    If you need to quote the args, you might have to include escaped quotes in the string: e.g. "\"PC1\""
    --[[ Indigo Rose Software Developer ]]

  3. #3
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Or you might write the batch file out from AMS so that you needn't worry about sending it command lines.

  4. #4
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173
    thanks gents

    i will go the Worm's way!

Posting Permissions

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