Deleting files with special characters in name

I am trying to delete certain files from a folder. Some of the files have special characters in its name like

¬.stat
˜.stat
Ÿ.stat

I am using the below action script

delete __appendfile
delete __del.bat
appendfile {("del %22" & pathname of it & "%22") of (files of folder "C:\Program Files (x86)\BigFix Enterprise\BES Client\__BESData\__Global\UsageData") whose (length of name of it < 7)}
copy __appendfile __del.bat
waithidden __del.bat

But the problem is that relevance query returns the file names as
%90.stat, %a0.stat, etc
So the del command does not work on those. How do I get it to return the correct pathname?

Did you look inside the actual __del.bat file to see that it contained the %'s ?

You might need to use a powershell script, VBScript, or something similar to actually achieve this due to relevance not handling Unicode well.

1 Like

yes it did contain the %… something. Not the original filenames that I wanted. Thanks for the suggestion. Looks like I will have to go ahead with powershell or vbscript.

It might be possible to tell the relevance to output the characters “unescaped” to get it to work, but I’m not sure how.

Also, it could be that appendfile only handles ASCII.

I wonder if using createfile instead of appendfile would have different results?