Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd like to be able to quickly start a Google search from my desktop (Win XP), whether or not I have a browser open. Something along the lines of WinG, then I can simply start typing my search term and hit Enter.

Does such a solution exist?

share|improve this question
add comment

4 Answers 4

up vote 4 down vote accepted

AutoHotKey will allow you to set up a custom script to open your browser and navigate to a desired page in one shot. For example, the script to launch Firefox and go to Google using Win + G is as simple as this:

#g::
run % "C:\Program Files\Mozilla Firefox\firefox.exe http://www.google.com" 
share|improve this answer
add comment

It's not difficult. All you really need is a way of opening a URL and a simple script to generate the URL you need, munging any special characters in the query, filling in the google.com domain and the rest of what Google expects.

Here's very minimal (call it "proof of concept") example I just did with my C shell. The only special characters it treats are spaces, which it turns into + signs as expected by Google.

proc google( terms )
   set terms = "$terms:gS/ /+/"
   open "http://www.google.com/search?ie=ISO-8859-1&hl=en&source=hp&q=$terms&gbv=1&oq=$terms"
end

Having defined this procedure, if I type google hamilton laboratories, I get this opening in a new tab in my default browser, which happens to be Chrome.

To do the same thing under cmd.exe, you'd probably use the start command to open the URL. I'm not an expert in cmd.exe, so I leave it to others to edit this answer to fill in the rest of a cmd.exe sample script with the preferred way to do the string manipulation.

share|improve this answer
add comment

I use the following AutoHotKey script to search a word or phrase I've selected just about anywhere, for example in my browser, word-processor, help file, or IDE. That isn't exactly what you asked for, but I thought it might be useful anyway. Come to think of it, it probably could be modified to prompt for search term(s) when none are selected...

#SingleInstance force ; skip the dialog box and replace the old instance
#NoEnv ; avoid checking empty variables to see if they are environment variables

; ---------------------------------------------------------------------
; Search Google for currently selected text (in any application)
;
#g:: ; winkey+g
SaveClip := ClipboardAll
Clipboard=
Send ^c
ClipWait
; Clean up clipboard contents
; note: call written as assignment because ByRef parm passing doesn't
; work on built-in Clipboard variable
Clipboard := CleanString(Clipboard)

Clipboard := urlEncode(Clipboard)

; Search Google for the exact phrase
Run http://www.google.com/search?hl=en&newwindow=1&as_q=&as_epq=%Clipboard%&as_oq=&as_eq=&num=100&lr=lang_en&as_filetype=&ft=i&as_sitesearch=&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=off
; restore clipboard
Clipboard := SaveClip
SaveClip =
return

CleanString(str){
    ; Convert control characters 00-1F hex (0-31 decimal) and 7F (127 decimal) to spaces.
    loop, 32
        StringReplace, str, str, % Chr(A_Index-1), %A_Space%, All
    ; Collapse all runs of spaces to a single space
    loop
    {
        StringReplace, str, str, %A_Space%%A_Space%, %A_Space%, UseErrorLevel
        if ErrorLevel = 0 ; No more replacements needed.
            break
    }

    str = %str% ; remove leading and trailing spaces and tabs (assumes AutoTrim is on)

    return, str
}
share|improve this answer
add comment

Here is a possible solution. I have made a script in AutoHotKey. http://techtoll.in/1178/open-your-favorite-websites-with-just-a-keystroke/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.