Ms access 使用windows资源管理器搜索文件
我有许多组织的列表,每个组织。有数百人的列表,每个人在组织文件夹中都有一个扫描文档,现在我的应用程序上有一个btn打开组织文件夹,用户正在搜索此人,但用户希望btn打开windows资源管理器自动搜索此人 我发现这个代码:Ms access 使用windows资源管理器搜索文件,ms-access,Ms Access,我有许多组织的列表,每个组织。有数百人的列表,每个人在组织文件夹中都有一个扫描文档,现在我的应用程序上有一个btn打开组织文件夹,用户正在搜索此人,但用户希望btn打开windows资源管理器自动搜索此人 我发现这个代码: Shell("c:\Windows\explorer.exe ""search-ms:displayname=Search%20Results&crumb=System.Generic.String%3A" & <variable> & "
Shell("c:\Windows\explorer.exe ""search-ms:displayname=Search%20Results&crumb=System.Generic.String%3A" & <variable> & "&crumb=location:<your search location>%", vbNormalFocus)
有什么建议吗
我在这里添加我的代码:
Private Sub cmdView_Click()
Dim strPath As String
strPath = CurrentProject.Path & "\Scans\" & DLookup("OrgName", "tblOrganizations", "ID=" & Me.OrgID)
'Shell "C:\WINDOWS\explorer.exe """ & strPath & "", vbNormalFocus
Call Shell("c:\Windows\explorer.exe ""search-ms:displayname=Search%20Results&crumb=System.Generic.String%3A" & Me.Phone & "&crumb=location:" & strPath & "%""", vbNormalFocus)
End Sub
Shell(“c:\Windows\explorer.exe”“搜索ms:displayname=search%20Results&crumb=System.Generic.String%3A”&&&crumb=location:%“”,vbNormalFocus)
这应该可以解决问题,正如parakmiakos所说,您错过了一个双引号(由于是字符串,所以是三引号)。这里有一个简单的解决方案,只使用一个通用的批处理(.bat)文件,任何人都可以仅使用notepad.exe创建该文件:
:: Text to search for
SET name=Winamp
:: Directory to search in
SET dir=C:\Program Files (x86)
:: ** Command Line **
C:\Windows\Explorer.exe "search-ms:displayname=Search Results in %dir%&crumb=System.Generic.String:%name%&crumb=location:%dir%"
注释-
我想你错过了另一个双引号的地方。。。很可能是在你命令结束时。还有,别忘了转义。谢谢,我会想办法的。是的,你在
explorer.exe
之后有一个开头转义(加倍)的引号,结尾没有结尾。我尝试过,但仍然出现错误,请看我在问题中添加的代码。这是C#And.NET。他要求微软访问。
Shell("c:\Windows\explorer.exe ""search-ms:displayname=Search%20Results&crumb=System.Generic.String%3A" & <variable> & "&crumb=location:<your search location>%""", vbNormalFocus)
string folder = Uri.EscapeDataString(@"C:\");
string file = "size:huge";
string uri = "search:query=" + file + "&crumb=location:" + folder;
var files = Process.Start(new ProcessStartInfo(uri));
:: Text to search for
SET name=Winamp
:: Directory to search in
SET dir=C:\Program Files (x86)
:: ** Command Line **
C:\Windows\Explorer.exe "search-ms:displayname=Search Results in %dir%&crumb=System.Generic.String:%name%&crumb=location:%dir%"