Open explorer search from excel hyperlink [closed]

我只是一个虾纸丫 提交于 2019-12-14 03:22:26

问题


I am working on a project, and my current goal is to write a script for excel that will open a windows explorer search to an already set location, searching for the cell value.

I think this would be easiest with shell, but I just can't find out how to do this with a command in cmd.

I have found lots of stuff opening finder and explorer(even on the exact file location), but I just can't combine them to search for the file I would add in a variable in the exact location.

I am thinking of something like this:

https://superuser.com/questions/499238/command-to-open-windows-explorer-window-with-filtered-results

Edit: what I was trying to say is that, for example, I have a place on a server where all my computer backups automatically gets saved with the backup name <pcname+backup date>. I also have a list where all my computer names are listed:

asdpc-1

asdpc-2

asdpc-3

In my excel list, those are made hyperlinks. My goal is: when I click on asdpc-1, it will open a window in explorer for me with the computer name in the search box, searching the server for asdpc-1's backup. I found this the best solution because of the date of the backup also gets included in the name. So this way I can see all the backups made for this pc.

I figured it out that I had some syntax problems, and I fixed it by now, so it's working fine as expected.


回答1:


ok I found the answer and it only took me 3 houres :-)

Shell("c:\Windows\explorer.exe ""search-ms:displayname=Search%20Results&crumb=System.Generic.String%3A" & <variable> & "&crumb=location:<your search location>%", vbNormalFocus)

to add location it is easyest to do the search manually just the way you want it to work, than copy the text after the "location:"



来源:https://stackoverflow.com/questions/24376850/open-explorer-search-from-excel-hyperlink

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!