Shell info wanted (1 Viewer)

kirkm

Registered User.
Local time
Tomorrow, 01:52
Joined
Oct 30, 2008
Messages
1,257
I'm attempting to open a Explorer/Folder and search for specific files using Shell. I found some info but can't get it to work :
Code:
Call Shell("explorer.exe " & Chr(34) & "search-ms:query=*.pdf&crumb=location:c:\ad\" & Chr(34), vbNormalFocus)
I'm not sure what does what and for me it Opens Internet Explorer so is a bit hard to test, However the following does Open MyFolder:

Code:
Call Shell("Explorer.exe /select," & MyFolder, vbNormalFocus)
Can I get Search Window up as well anyhow? I could then enter what to search for via keyboard.
 

sonic8

AWF VIP
Local time
Today, 13:52
Joined
Oct 27, 2015
Messages
998
Maybe the following does help:

Code:
Shell "explorer ""search-ms:crumb=System.Generic.String%3A*.pdf&crumb=location:C%3A%5Cad"""
 

isladogs

MVP / VIP
Local time
Today, 12:52
Joined
Jan 14, 2017
Messages
18,186
I'd never done anything like this before but I just tried the following & it worked perfectly for me:
Code:
Shell "explorer.exe " & Chr(34) & "search-ms:query=*.pdf&crumb=location:G:\MyFiles" & Chr(34), vbNormalFocus

So does
Code:
Call Shell ("explorer.exe " & Chr(34) & "search-ms:query=*.pdf&crumb=location:G:\MyFiles" & Chr(34), vbNormalFocus)

NOTE - I omitted the final backslash but otherwise same as yours

Both display all the PDF files in G:\MyFiles and subfolders and the Explorer bar says 'Search Results in MyFiles

I also tried Phillip's version - it also worked
Code:
Shell "explorer ""search-ms:crumb=System.Generic.String%3A*.pdf&crumb=location:G%3A%5CMyFiles"""

Thank you both....
 

kirkm

Registered User.
Local time
Tomorrow, 01:52
Joined
Oct 30, 2008
Messages
1,257
How/where are you applying the command ?
From the immediate window I always get it opening Internet Explorer.
 

isladogs

MVP / VIP
Local time
Today, 12:52
Joined
Jan 14, 2017
Messages
18,186
Also from the Immediate window - Access 2010 in Windows 10
 

Users who are viewing this thread

Top Bottom