Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 创建目录列表并添加文本_Windows_Batch File_Directory_Batch Processing - Fatal编程技术网

Windows 创建目录列表并添加文本

Windows 创建目录列表并添加文本,windows,batch-file,directory,batch-processing,Windows,Batch File,Directory,Batch Processing,我正在尝试创建一个批处理,可以在每行前面添加文本 我的批处理如下所示: dir /b /s /a-d-r /o:gen >%temp%\file_list.txt start notepad++ %temp%\file_list.txt 当前输出txt如下所示: C:\miscellaneous\u fixes\materials\贴花\manhackcut1.vtf C:\miscellaneous\u fixes\materials\贴花\manhackcut2.vtf 等等 这与我

我正在尝试创建一个批处理,可以在每行前面添加文本

我的批处理如下所示:

dir /b /s /a-d-r /o:gen >%temp%\file_list.txt
start notepad++ %temp%\file_list.txt
当前输出txt如下所示:

C:\miscellaneous\u fixes\materials\贴花\manhackcut1.vtf

C:\miscellaneous\u fixes\materials\贴花\manhackcut2.vtf

等等

这与我需要的非常接近,但我希望该批添加文本“-include,”,并具有如下最终文本:

dir /b /s /a-d-r /o:gen >%temp%\file_list.txt
start notepad++ %temp%\file_list.txt
-包括,C:\miscellaneous\u fixes\materials\贴花\manhackcut1.vtf

-包括,C:\miscellaneous\u fixes\materials\贴花\manhackcut2.vtf

等等

注意:每个“-include”前面的空格很重要,否则我的其他程序无法读取该文件

谢谢你的帮助

试着这样做:

@echo关闭
>%temp%\file\u list.txt(
@对于/f“delims=“%%a in('dir/b/s/a-d-r/o:gen')do echo-include,%%a
)
启动记事本+++%temp%\file\u list.txt
试着这样做:

@echo关闭
>%temp%\file\u list.txt(
@对于/f“delims=“%%a in('dir/b/s/a-d-r/o:gen')do echo-include,%%a
)
启动记事本+++%temp%\file\u list.txt