Question

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

Was it helpful?

Solution

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

OTHER TIPS

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"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top