![](/img/trans.png)
[英]How to make a batch file that works in the current folder and delete specific files?
[英]Batch: How to make a .txt file with all files in a folder without extensions
現在我有這個代碼:
@echo off
dir Maps /A-D /b /o:gne >Maplist.txt
start notepad Maplist.txt
但我像這樣制作Maplist.txt:
a.bsp
b.bsp
c.bsp
但我希望它沒有“.bsp”
請幫忙
您需要閱讀FOR命令 - 鍵入HELP FOR
或FOR /?
從命令窗口查看文檔。
以下代碼將完全按照您的要求執行。
@echo off
>Maplist.txt (
for %%F in (Maps\*) do @echo %%~nF
)
start notepad Maplist.txt
有語音標記令人討厭,我假設你不想要那些? (盡管它確實擺脫了擴展)
forfiles /p files /c "cmd /c echo @FNAME >> maplist.txt"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.