WinAutomation - windows automation software with macro recorder

      How to use variables in file paths

      If you have tried entering a variable in a path:

      you may have come across the following error: "File to copy not found", even though the variable contains the correct filename and extension.

      In WinAutomation the percent (%) char is a delimiter for expressions (or variables) but the \% combination equals to the literal % char. If, for example you want to display the message “50% of your disk is used”, you should write: “50\% of your disk is used”. In order to have a backslash and a % immediately after it (e.g. in a file path), you have to use the combination \\%.

      So, in this example:
      C:\My Files\%FileToCopy%  will not work while
      C:\My Files\\%FileToCopy% will work normally.

      The reason for this behavior is that the backslash character is designed to behave like an escape character in case that you need to write the actual percent (%) character.

      Your rating: None Average: 5 (7 votes)

      Comments:

      Post new comment

      The content of this field is kept private and will not be shown publicly.
      • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
      • Lines and paragraphs break automatically.
      • Web page addresses and e-mail addresses turn into links automatically.
      • You may quote other posts using [quote] tags.

      CAPTCHA
      This question is for testing whether you are a human visitor and to prevent automated spam submissions.
      Image CAPTCHA
      Enter the characters shown in the image.



      Featured Clients