problem passing arguments to a batch file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Martin_SBT
    Forum Member
    • Jun 2002
    • 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
  • Lorne
    Indigo Rose Staff Member
    • Feb 2001
    • 2729

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

    Comment

    • Worm
      Indigo Rose Customer
      • Jul 2002
      • 3971

      #3
      Or you might write the batch file out from AMS so that you needn't worry about sending it command lines.

      Comment

      • Martin_SBT
        Forum Member
        • Jun 2002
        • 173

        #4
        thanks gents

        i will go the Worm's way!:lol :lol :lol

        Comment

        Working...
        X