rsolomon
asked on
Find root name of file in DOS
How to get the root name of a file, using dos scripting?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I used *.txt as a generic filespec, but it can by any filespec or a specific file.
Note that in a batch file, you must double-up the % symbols as I did above. If you want to run that straight from a command line (no batch) then use single percents:
for %F in (*.txt) do @echo %~nF
for %F in (*.txt) do @echo %~nF