Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

get filename without extension in BAT (Users)

posted by jadoxa Homepage E-mail, Queensland, Australia, 04.05.2023, 03:08

> echo "%~n1" ->>> does not work in freedos

That is NT's CMD.EXE, not DOS' COMMAND.COM. Maybe HXDOS would work?

> How to get file C:\test from file C:\test.txt ???

Since FreeDOS comes with sed (at least, my install did):

echo %1 | sed -r s/^(.*)\..*/\1/ | set /p filename=

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 122 users online (0 registered, 122 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum