Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use cmd prompt to search a word on google or other search engine

I am trying to use a programming language to search google or another specified search engine. I would like to use windows cmd prompt to do so because the specified programming language has a simple command to access the cmd prompt.

Any ideas on how to search google from cmd prompt?

like image 646
Pareto Avatar asked Feb 08 '13 17:02

Pareto


People also ask

Can you use Google from the command line?

Open your Terminal and type "googler" followed by your search term. For example, let me search for the term - "ostechnix". You will get results related to "ostechnix" keyword.

How do I run command prompt without searching?

You can also use keyboard shortcuts for this route: Windows key + X, followed by C (non-admin) or A (admin). Type cmd in the search box, then press Enter to open the highlighted Command Prompt shortcut.


Video Answer


2 Answers

Simply type this on the command-line or in the run command and it will open your default browser to let Google search for SEARCHTERM:

start www.google.com/search?q=SEARCHTERM

Note that you have to replace whitespaces with pluses, e.g.

start www.google.com/search?q=Use+cmd+prompt+to+search+a+word+on+google+or+other+search+engine

Alternatively you could also put this command in a batch file:

@start www.google.com/search?q=%1+%2+%3+%4+%5+%6+%7+%8+%9
like image 72
Andreas Avatar answered Oct 21 '22 04:10

Andreas


easy.

@echo off
color a
setlocal ENABLEDELAYEDEXPANSION
echo Google Batch
echo Made By GenoSans
start https://discord.gg/WwRtbBe
timeout -t 5 /nobreak
:a
cls
echo                                            ,,
echo   .g8'''bgd                               `7MM
echo .dP'     `M                                 MM
echo dM'       `   ,pW'Wq.   ,pW'Wq.   .P'Ybmmm  MM  .gP'Ya
echo MM           6W'   `Wb 6W'   `Wb :MI  I8    MM ,M'   Yb
echo MM.    `7MMF'8M     M8 8M     M8  WmmmP'    MM 8M''''''
echo `Mb.     MM  YA.   ,A9 YA.   ,A9 8M         MM YM.    ,
echo   `'bmmmdPY   `Ybmd9'   `Ybmd9'   YMMMMMb .JMML.`Mbmmd'
echo                                  6'     dP
echo                                   Ybmmmd'
echo.
set /p s=Search: 
set word=+
set str=%s%
set str=%str: =!word!%
start http://www.google.com/search?q=%str%
goto a
like image 27
Jonathan Pettersson Avatar answered Oct 21 '22 03:10

Jonathan Pettersson