4 Replies Latest reply on Jan 2, 2017 3:29 PM by user19752

    Quote includes "(" and " * "

    AA

      Hi,

       

      I am facing an issue that the quotes includes parentheses and a star (*) and no clue how to avoid it as I always get error message (1204).

       

      I want to use the Send Event script however I would like to use a variable as well. I split the text into two parts and in the middle the variable takes place.

       

      Here is the full quote that goes to command line:

      cmd c/ (for %F in (C:\Folder\*) do @echo %~dpF) >dir.txt

        • 1. Re: Quote includes "(" and " * "
          keywords

          Have you considered encasing the whole expression in the Quote ( ) function?

          • 2. Re: Quote includes "(" and " * "
            AA

            I did however the Path: "C:\Folder\" should change according to the user preferences and his file structure.

             

            I try using Get NthRecord or Script Parameter but no luck so far. When I use them I get an empty file.

            By implementing the Let function it gives me the same result.

             

            The issue is probably the two parentheses and also the multiplier symbol. Theoretically Let function should work.

             

            (C:\Folder\*)

            • 3. Re: Quote includes "(" and " * "
              erolst

              AA wrote:

               

              The issue is probably the two parentheses and also the multiplier symbol. Theoretically Let function should work.

               

              (C:\Folder\*)

              If you have backslashes (or parentheses), you need to escape them - using backslashes ...

              • 4. Re: Quote includes "(" and " * "
                user19752

                You are correct, but FM removes the backslash if following character does not need it.

                 

                AA, where is the preference?

                You can use something like

                Substitute ( "cmd /c (for %F in (C:\Folder\*) do @echo %~dpF) >dir.txt" ; "C:\Folder\*" ; $PathFromPreference )

                 

                I found your typo in c/, should be /c. (but not tested)