Page 1 of 1

SC listfolder()

Posted: 26 Jan 2024 17:33
by Daniel0312
I want to list files with name explicitely containing "#" character
For testing purpose I did the following:

Code: Select all

  e new("%TEMP%\TempFile#202.txt");
  e listfolder(%TEMP%, "TempFile#*.txt");
If the first line returns the successfully created file, the second one returns nothing :cry:
Can anyone tell me how to do ?

Re: SC listfolder()

Posted: 26 Jan 2024 17:59
by highend
# itself is a pattern (= digits), escape it by surrounding it with square brackets [#]

Re: SC listfolder()

Posted: 26 Jan 2024 18:19
by Daniel0312
thanks highend (thought it might be, just couldn't find the escape character).
Could you tell me if there are other characters in file names I should escape the same way ?

Re: SC listfolder()

Posted: 26 Jan 2024 19:13
by highend
No. * and ? can't be part of regular file names in Windows so they don't need to be escaped

Re: SC listfolder()

Posted: 26 Jan 2024 19:45
by Daniel0312
thank you