3

我正在尝试创建一个应用程序,该应用程序打开 Windows 资源管理器搜索功能并搜索输入了指定术语的文件/文件夹。我已经有 Windows 索引服务引入的 Windows Vista SP1+(使用“search:query=”)命令的代码。这在 Windows XP 中不起作用,因此我正在寻找一个命令/代码(命令行、批处理脚本、c++ 等),该命令/代码将在“查找文件/文件夹”模式下打开 Windows 资源管理器,同时输入搜索词(使用命令从应用程序发送)。谢谢

4

1 回答 1

2

Yes, there is a (really long) command that can do a search.

explorer.exe search-ms:displayname=Search Results (or put whatever title you want)&crumb=System.Generic.String%3A(search string)&crumb=location:(path)

Here's a breakdown of how it works:

If you run explorer.exe path, it will open the path you specify.
If you do a search and click on the icon used to show a path, it will show you a really long string of data. You can enter it as a path, and it will take you right back to the search.
In case you haven't figured it out, you can enter a command to take you to that path, therefore running a search.

于 2018-04-10T22:28:10.237 回答