Use cmd prompt to search a word on google or other

2019-04-09 02:32发布

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?

8条回答
小情绪 Triste *
2楼-- · 2019-04-09 03:03

You can write in the ps1 file:

function googleSearch{start www.google.com/search?q=$args}
set-alias g googleSearch

then restart your powershell,

g whatwhatwhat
查看更多
男人必须洒脱
3楼-- · 2019-04-09 03:08

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
查看更多
登录 后发表回答