Winhelponline.com - http://www.winhelponline.com
How to launch Search Companion with the "Look in" option pointing to a specific folder or drive?
http://www.winhelponline.com/articles/42/1/How-to-launch-Search-Companion-with-the-Look-in-option-pointing-to-a-specific-folder-or-drive.html
By Ramesh Srinivasan
Published on 
 
Scripts to launch search companion with a default "Look in" destination folder or drive.

How to launch Search Companion with the "Look in" option pointing to a specific folder or

Would you like to have a shortcut which launches Search Companion with the default "Look in" option, pointing to a specific folder or drive? The script below does that exactly:

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\")
Set objFolderItem = objFolder.ParseName("myfolder")
objFolderItem.InvokeVerb("find")

The above script opens a Search window with the folder C:\Myfolder as the default target in the "Look in" box. If you want a different path, edit the script accordingly. Then copy the above code to Notepad, save the above contents to a file with .VBS extension (Search.VBS) and then place the shortcut of the script in your Quick Launch folder.

To open Search companion with a specified drive chosen as the default, use the following:

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H11&)
Set objFolderItem = objFolder.ParseName("D:\")
objFolderItem.InvokeVerb("find")