循环遍历目录并获取文件名并将名称连接到字符串的批处理脚本

Batch Script to Loop through directory and fetch file name and concatenate the names to a string

我需要使用批处理脚本准备批处理文件 1)循环遍历给定目录中的文件(.csv)文件,只取出CSV文件的名称 2) 使用此 csv 文件名并与下面的字符串连接

"String1" "File Name1"
"String2"
"String1" "File Name2"
"String2"
"String1" "File Name3"
"String2"

3) 将此输出重定向到另一个批处理文件。

我是创建批处理脚本的新手。任何人都可以帮助我提出创建脚本的想法吗?

像这样:

编辑:

@echo off
set $string="TOTO"
set $string2="TATA"
set "$Path=c:\test\"

pushd %$Path%
(for %%a in (*.csv) do (
    echo %%~dpnxa %$string%
    echo %$string2%))>Output.txt
popd