Is there an easy way to get to the basename (file name without extension) of a DOS file name using the DOS BAT command language?
I agree: format c:\\ is
format c:\\
For command-line
for /F %i in ("c:\foo\bar.txt") do @echo %~ni
For .bat Files
for /F %%i in ("c:\foo\bar.txt") do @echo %%~ni
output: bar
bar
space
(Further Reading: http://www.computerhope.com/forhlp.htm )