How to extract the filename extension out of %f in script?
15,799
Change echo %%f to echo %%~nf.
~n tells the cmd to expand f to equal only the filename, minus the extension.
Related videos on Youtube
Comments
-
Everyone over 1 year
The windows %%f returns the full name of the file as 'filename.ext'
e.g.
for /r %%f in (*.wav) do echo %%f
Is there a way to extract the filename without the extension from %%f?
-
Everyone almost 13 yearsThanks mate! May I be so bold as to enquire how you acquired that little tid-bit?
-
surfasb almost 13 yearsFrom the horse's mouth: technet.microsoft.com/en-us/library/bb490909.aspx. Generally, anything Product related is going to be under technet.microsoft.com. Anything programming related is going to be under msdn.microsoft.com (Microsoft Developer's network).