Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.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_Find_Dos - Fatal编程技术网

Windows 通过命令提示符查找

Windows 通过命令提示符查找,windows,find,dos,Windows,Find,Dos,如何通过命令提示符查找任何目录(如c:\、d:\等)中的所有*.txt文件?尝试使用dir*.txt以下内容将从根目录及其所有可访问的子文件夹进行搜索,而不考虑您当前所在的文件夹 c: cd \ dir /s *.txt d: cd \ dir /s *.txt dir \*.txt /s 或 etc“在任何目录中,”他说::-)哎呀,不知怎的,我以为他想要一个命令,可以在那个特定的目录中运行…:|属于superuser.com,尽管它只搜索子目录,所以您需要cd到根目录。我也不知道如何让它

如何通过命令提示符查找任何目录(如c:\、d:\等)中的所有*.txt文件?

尝试使用
dir*.txt

以下内容将从根目录及其所有可访问的子文件夹进行搜索,而不考虑您当前所在的文件夹

c:
cd \
dir /s *.txt
d:
cd \
dir /s *.txt
dir \*.txt /s


etc

“在任何目录中,”他说::-)哎呀,不知怎的,我以为他想要一个命令,可以在那个特定的目录中运行…:|属于superuser.com,尽管它只搜索子目录,所以您需要
cd
到根目录。我也不知道如何让它搜索所有驱动器(即,如果你在C:\,它不会自动搜索D:\)
dir c:\*.txt /s
dir d:\*.txt /s
setlocal ENABLEEXTENSIONS
FOR %%A IN (a b c d e f g h i j k l m n o p q r s t u v w x y z) DO @call :dumpdrive %%A
echo Done...
goto :EOF
:dumpdrive
FOR /R "%1:\" %%B IN (*.txt) DO @echo.%%~fB
goto :EOF