开发者

How to just echo file name and not the full directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 4 hours ago.

Improve this question

How can I dump the file name only from a for loop that iterates a directory into a mytextfile.txt file

@echo off
    
SETLOCAL enabledelayed开发者_如何学编程expansion
TITLE Demo Mode
SET mypath=%cd%
SET "remote_dir=\remote\*"
SET "GLOB_PREFIX=anzac_house_"
SET "FULL_REMOTE_DIR=%mypath%%remote_dir%"
    
ECHO REMOTE DIR:
FOR %%a IN ("%FULL_REMOTE_DIR%") DO ECHO %%a

Expected results in mytextfile.txt should be:

file1.txt
file2.png
blah3.html
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜