首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >Windows如何过滤出某后缀的文件路径

Windows如何过滤出某后缀的文件路径

原创
作者头像
Windows技术交流
修改于 2022-06-25 01:47:32
修改于 2022-06-25 01:47:32
2.4K0
举报
文章被收录于专栏:Windows技术交流Windows技术交流

方法1:用everything搜索

比如要搜system32目录的.dll文件

输入目录的绝对路径 空格 .dll,然后按路径排序,然后按住shift选择system32根目录的文件,右击点复制完整路径和文件名,粘贴到记事本文件里即可

方法2:用powershell命令,比如导出windows根目录 system32根目录的可执行文件,举例如下

比较low的代码

cd "c:\windows\system32"

ls *.exe,*.cpl,*.msc > c:\command.txt

cd "c:\windows"

ls *.exe,*.cpl,*.msc >> c:\command.txt

notepad c:\command.txt

如果是.dll,换下后缀字符即可。

比较牛逼的代码

Get-ChildItem -Path C:\Windows\System32 -Filter ***.dll** -File | Sort-Object Length -Descending | ForEach-Object { $_.Name }

Get-ChildItem -Path C:\Windows\System32 -Filter ***.dll** -File | Sort-Object Length -Descending | ForEach-Object { $_.BaseName }

(Get-ChildItem -Path C:\Windows\System32 -Filter ***.dll** -File | Sort-Object Length -Descending | ForEach-Object { $_.FullName }).count

Get-ChildItem -Path C:\Windows\System32 -Filter ***.dll** -File | Sort-Object Length -Descending | ForEach-Object { $_.FullName } | Out-File -Append c:\system32_.dll.txt

notepad c:\system32_.dll.txt

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档