SC listfolder()

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Daniel0312
Posts: 238
Joined: 15 Feb 2016 10:48

SC listfolder()

Post 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 ?
Daniel
XY32 latest stable / Windows11 23H2 / Scaling 100%

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: SC listfolder()

Post by highend »

# itself is a pattern (= digits), escape it by surrounding it with square brackets [#]
One of my scripts helped you out? Please donate via Paypal

Daniel0312
Posts: 238
Joined: 15 Feb 2016 10:48

Re: SC listfolder()

Post 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 ?
Daniel
XY32 latest stable / Windows11 23H2 / Scaling 100%

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: SC listfolder()

Post by highend »

No. * and ? can't be part of regular file names in Windows so they don't need to be escaped
One of my scripts helped you out? Please donate via Paypal

Daniel0312
Posts: 238
Joined: 15 Feb 2016 10:48

Re: SC listfolder()

Post by Daniel0312 »

thank you
Daniel
XY32 latest stable / Windows11 23H2 / Scaling 100%

Post Reply