Pergunta

right now i have this code:

@echo off

dir Maps /A-D /b /o:gne >Maplist.txt

start notepad Maplist.txt

But i makes Maplist.txt like this:

a.bsp

b.bsp

c.bsp

but i want it without ".bsp"

please help

Foi útil?

Solução

You need to read up on the FOR command - type HELP FOR or FOR /? from the command window to see the documentation.

The following code will do exactly what you want.

@echo off
>Maplist.txt (
  for %%F in (Maps\*) do @echo %%~nF
)
start notepad Maplist.txt

Outras dicas

Has speech marks annoyingly, I'm assuming you don't want those either? (It does get rid of extension though)

forfiles /p files /c "cmd /c echo @FNAME >> maplist.txt"
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top