Google on your cmd-line


It’s been a couple days since my last post and this is my meager attempt at blogging on a regular basis…

Anyway, I wrote a cmd line interface for the Google Chrome browser. Chrome comes with command line options but it’s somewhat cumbersome.

Here’s the help for the batch script I wrote:

Usage: google [-b][-cdrive][-n][-url][-s][-mail][-maps][-dev][-code] Args

google -b         Opens a blank web page (about:blank)
google -cdrive    Opens the browser to your C:\ Drive
google -n         Opens a new window
google -s         Navigates to (-s - search)
google -home      Also, navigates to
google -mail      Navigates to GMail
google -maps      Navigates to Google Maps
google -dev       Navigates to Google Developer
google -code      Navigates to Google Code

google -url ""
Opens a browser to the url supplied

google "multiline grep" "perl 6" perlmonks
This would open 3 new tabs in chrome.
Showing search results for 'multiline grep', 'perl 6' and 'perlmonks'.
Meaning that quotes are needed for multi-word searches.

As you can see it provides a lot of Google’s functionality.

You can find it here.

There are three steps that need to be completed before it’s usable.

  1. Add chrome.exe to your PATH environment variable.
  2. Download the google.bat.txt and remove .txt extension.
  3. Add google.bat to your PATH environment variable as well.

There are countless articles on how to modify your PATH variable on Windows.

And as a side note, this batch script only works on Windows. I’ve tested it on XP and 7. I’ll eventually post one for Linux as well.

Email me with issues if they arise.

One thought on “Google on your cmd-line

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>