路径中的目录通配符 [英] Directory wildcard in path

查看:90
本文介绍了路径中的目录通配符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我使用 Windows CMD 命令以来已经有很长时间了.我想在目录列表的命名子目录中列出 PDF 文件.所以我想我需要通配父目录.

It's been ages since I used Windows CMD commands. I want to list the PDF files in a named subdirectory of a list of directories. So I think I need to wildcard the parent directories.

例如:

drive:\maindirectory\[wildcard]\subdirectory\*.pdf

我该怎么做?

推荐答案

这里是单行命令,只需编辑模式搜索并复制粘贴到cmd中即可.

here is one-liner command, just edit the pattern search and copy paste into cmd.

@for /f "delims=" %a in (^
'dir /b /s /ad "maindirectory\w?ldc?rd"^| findstr /c:subdirectory'^
) do @dir /b /a-d "%a\*.pdf"

这篇关于路径中的目录通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆