6 Replies Latest reply on Aug 17, 2016 5:52 PM by user19752

    batch command example

    kamal1234

      Dear community members,

       

      I want to run .bat file with two arguments to execute php file on command line and get result back.

      Is there any small example how to achieve it.

      I have never used set event command in filemaker.

      Thank you,

      Kamal

        • 1. Re: batch command example
          kamal1234

          In context to above mention problem. Please can any one can help to identify what wrong I am doing in my script below.

           

          I want to pass two parameters to my batch file. It works I select batch from from file menu.

           

          Thank you

          Kamal.

           

           

          Script.JPG

          • 2. Re: batch command example
            kamal1234

            After debugging, I came to know that above script works without passing two parameters $source and $dest.

            If any one has idea about passing parameters to batch file that will be a great help.

            Thank you,

            Kamal.

            • 3. Re: batch command example
              DLarsen

              Looks like you are trying to copy a file from one folder to another, correct? The basic command is like this:

               

              CMD /C COPY c:\Folder_A\Source.txt C:\Folder_B

               

              This should copy a file named Source.txt from Folder_A to Folder_B.

               

              CMD opens the command window and the /C closes the window when it is complete.

               

              You will run into trouble if your filenames or paths have any spaces in them. If that condition exists you will need to wrap each parameter in quotes. Also be aware that you need to use backslashes rather than the forward slashes that are common in Filemaker work.

               

              Be aware that I am going by memory and I haven't done any testing on your exact scenario.

              • 4. Re: batch command example
                kamal1234

                Hello Larsen,

                 

                Thank you very much for prompt reply. Yes, I am finding files from source and copy to destination.

                 

                I have more then 20000 files needs to compare with excel records and find them in particular folders.

                My php batch files are ready. I am executing .bat and .sh files to run my php cli in back ground.

                 

                I need to filemaker GUI just to make it user friendly so that user can select source and destination folders.

                My only problem is I am not be able to pass the source and destination using send event command. If I don't pass parameter it works fine. I need to hard code source and destination in batch/php file.

                 

                Thank you

                Kamal.

                • 5. Re: batch command example
                  philmodjunk

                  It's also possible to set up a table of command lines in FileMaker and use export Records to export to the temporary folder with the option to automatically open the file specified. This creates, opens and thus runs a batch file--provided that you specify the .bat file extension.

                   

                  Fields exported can be calculation fields that insert data specific to the current situation to customize the command lines to what you need.

                  • 6. Re: batch command example
                    user19752

                    You don't need "filewin:" and you would need quote for parameters depend on its value (spece in the path etc.).