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
Batch file 使用拖放文件作为/f findstr_Batch File_Drag And Drop_Dos_Findstr - Fatal编程技术网

Batch file 使用拖放文件作为/f findstr

Batch file 使用拖放文件作为/f findstr,batch-file,drag-and-drop,dos,findstr,Batch File,Drag And Drop,Dos,Findstr,我正在尝试编写一个脚本,用户可以在其中拖放一个*.txt或空白的扩展名文件 /F文件列表搜索字符串有什么建议吗 到目前为止,我只有这些 @echo off for /F %%i in (*.) do ( echo searching for %%i Findstr /s /I /n "%%i" *.txt >>\\myourput.csv ) %*代表“所有参数”(如果将一个或多个文件拖动到批处理文件,批处理文件将以这些文件作为参数运行) 使用%1仅使用第一个参数

我正在尝试编写一个脚本,用户可以在其中拖放一个*.txt或空白的扩展名文件 /F文件列表搜索字符串有什么建议吗

到目前为止,我只有这些

@echo off 
for /F %%i in (*.) do (
  echo searching for %%i 
  Findstr  /s /I /n   "%%i" *.txt >>\\myourput.csv
)
%*
代表“所有参数”(如果将一个或多个文件拖动到批处理文件,批处理文件将以这些文件作为参数运行)

使用
%1
仅使用第一个参数

for /F %%i in (%*) do (