- Home
- Windows XP
- Customize
- How to launch Search Companion with the "Look in" option pointing to a specific folder or drive?
- Home
- Windows XP
- Scripts
- How to launch Search Companion with the "Look in" option pointing to a specific folder or drive?
How to launch Search Companion with the "Look in" option pointing to a specific folder or drive?
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")
If you enjoyed this post, make sure you
subscribe to our RSS feed!
We feature Tips, Troubleshooting information, Scripts and Utilities for Microsoft Windows Operating Systems!
Prefer an E-mail subscription?

