How to just echo file name and not the full directory [closed]
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 questionHow 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
精彩评论