From: the xplorer² website blog[xplorer²] — Search online for a file
Sometimes you may be wondering what some file is doing on your PC. An easy way to find out if it is good or bad is to search online for it. For example Process Explorer has an online search menu command that will show information about any running process so you can be sure it isn't some malware infecting your computer.
To search for a file online the obvious solution would be to copy its filename, open your internet browser, and use the search box to start a search for it. But that is too much work; wouldn't you prefer a context menu command to google search a file selected in windows explorer or xplorer²? Surprisingly there is no such command available, so let's create one. The simplest solution would be to create a WSH script that accepts the filename as an argument:
Set objArgs = WScript.Arguments
Set WshShell = WScript.CreateObject("WScript.Shell")
' extract the filename from the full path
pos = InstrRev(objArgs(0), "\")
filename = mid(objArgs(0), pos+1)
WshShell.Run "http://google.com/search?q=" & filename
You can use notepad to type this script and save it as GOOGLESEARCH.VBS — or simply download it from here. You don't need to understand how this script works, but in essense it just launches a google search by running a suitably formatted URL that contains the filename to search. This will open your default internet browser.
How do we pass the filename to this script? One solution would be to save this GOOGLESEARCH.VBS on your desktop and drag-drop the file you want to inspect on its icon. But as we are looking for a convenient context menu approach we will save it in the system Send To folder, so that it appears in the SendTo submenu when you right click on a file — see the picture to the right. send to google search
Commands that appear in the send to submenu are just shortcuts in a folder called C:\Users\someUser\AppData\Roaming\Microsoft\Windows\SendTo (you can access this folder easily from xplorer² using Goto > Special folders > Send to menu command). For example if you paste a shortcut to windows Notepad in there, there will be a command to send a file to notepad (i.e. edit it as text). As our script is really small we don't put a shortcut to it, but store the whole file in the send to folder.
So in summary, to enable google search for files on your computer:
- Download the script and save it on your computer
- Copy this script in the SendTo folder using xplorer² Goto > Special folders menu
- Right click on any file you want examined and pick the google search command from the send to menu