Answer the question
In order to leave comments, you need to log in
How to create a variable with a file name?
How, using my code
1) create a result.txt variable in which the data will be saved
2) wrap to a new line (@echo: >> result.txt wraps with an extra space)
Source code
echo off
for %%f in ("C:\FOLDER\*.*") do (
@echo %%~nf >> result.txt
@echo %%~zf >> result.txt
@echo: >> result.txt
)
echo off
set filename = result.txt
for %%f in ("C:\FOLDER\*.*") do (
@echo %%~nf >> %filename%
@echo %%~zf >> %filename%
@echo: >> %filename%
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question