I knew that years ago I’ve already used it but now I can’t get it up running …
I want a TCC command running on several jpg’s and the output should consider only the file name and not the extension.
I’ve tried this without success:
for %a in (St-Tropez-1984*.jpg) do cwebp -q 80 %a -o %@name[%file].webp
E.g. one file name is St-Tropez-1984_1280w.jpg and the output name should be St-Tropez-1984_1280w.webp.
If I’m just using %a.webp for the output the “.jpg” part isn’t discarded and I got file names like St-Tropez-1984_1280w.jpg.webp.
I will try your BTM, thank you (I don't understand everything now).
My goal is to separate the file name and extension and process the file(s) so that the CWEBP program can add its webp extension but take the jpg extension for input. If it works then I could write a BTM that does the command on all jpegs in a folder and process them to webp.
The BTM works very well, thank you!
What I do not understand is the switch "/a:-d". Is this an attribute selection with directories? And why is this needed?
Ah, and now thanks to your BTM I got my one-liner working: for %a in (*.jpg) do cwebp -q 80 %a -o %@name[%a].webp
This will convert every JPG file to WEBP.
Thanks again.
The BTM works very well, thank you!
What I do not understand is the switch "/a:-d". Is this an attribute selection with directories? And why is this needed?
He's excluding directories. DO, by default, returns both files and directories. DO /A:-D returns only files. DO /A:D (without the minus) would return only directories, not files.
In fact it's unlikely that you have any subdirectories that would match that wildcard pattern. Juppy is being professional here: considering the unlikely, and checking for errors.
Thank you very much for the explanation. I did read the help file but somehow missed the little "-" and wondered why an attribute "directory" is needed ...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.