Answer the question
In order to leave comments, you need to log in
How to save in a text file the name of the current directory, where is the batch file?
I wrote a simple batch file that saves the name of the files located in the current directory, you need to substitute the path along which they are located for these files and save it all in a txt file
setlocal EnableDelayedExpansion
dir /b %path % > myFiles.txt
Answer the question
In order to leave comments, you need to log in
If you add the /s switch to dir, then there will be full paths, but the contents of the subdirectories and the subdirectories themselves will appear. If there are no subdirectories, then this option is fine.
If there is, then you have to do in for:
for %%a in ("%pathdir%\*") do >>myFiles.txt echo.%%~fa
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question