Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

problem passing arguments to a batch file

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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


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

      Comment


      • #4
        thanks gents

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

        Comment

        Working...
        X