Hai Sobat Blogger... Sering Menggunakan fasilitas search engine seperti Google, Yahoo, or MSN..?? Pernah bermimpi menggunakan batch file untuk mencari sesuatu tanpa harus membuka browser terlebih dahulu..?? Kalau belum sekarang saya akan mewujudkan impian anda…:
HERE is THE CODE
(tested on Windows XP sp 2)
code:
------------------------------------start script----------------------------------------
@echo off
TITLE Internet Search
mode 27,10
:start
(set i=)
(set g=)
(set y=)
(set m=)
cls
echo --------------------------
echo [ Available SearchEngine ]
echo --------------------------
echo [ 1. Google ]
echo [ 2. Yahoo ]
echo [ 3. MSN ]
set /p i=Choose SearchEngine:
if not defined i goto start
if "%i%"=="1" goto google
if "%i%"=="2" goto yahoo
if "%i%"=="3" goto msn
goto start
:google
set /p g=Google Search:
if not defined g goto start
set g=%g: =+%
set g=%g:+/= %
call :gsearch %g%
goto start
:gsearch
if /i "%2"=="" start http://www.google.com/search?q=%1
if /i "%2"=="w" start http://www.google.com/search?q=%1
if /i "%2"=="i" start http://images.google.com/images?q=%1
if /i "%2"=="v" start http://video.google.com/videosearch?q=%1
goto :eof
:yahoo
set /p y=Yahoo Search:
if not defined y goto start
set y=%y: =+%
set y=%y:+/= %
call :ysearch %g%
goto start
:ysearch
if /i "%2"=="" start http://search.yahoo.com/search?p=%1
if /i "%2"=="w" start http://search.yahoo.com/search?p=%1
if /i "%2"=="i" start http://images.search.yahoo.com/search/images?p=%1
if /i "%2"=="v" start http://video.search.yahoo.com/search/video?p=%1
goto :eof
:msn
set /p m=MSN Search:
if not defined m goto start
set m=%m: =+%
set m=%m:+/= %
call :msearch %g%
goto start
:msearch
if /i "%2"=="" start http://search.msn.com/results.aspx?q=%1
if /i "%2"=="w" start http://search.msn.com/results.aspx?q=%1
if /i "%2"=="i" start http://search.msn.com/images/results.aspx?q=%1
if /i "%2"=="v" start http://search.msn.com/results.aspx?q=%1+mpeg
goto :eof
-------------------------------------end of script------------------------------------
------------------------------------start script----------------------------------------
@echo off
TITLE Internet Search
mode 27,10
:start
(set i=)
(set g=)
(set y=)
(set m=)
cls
echo --------------------------
echo [ Available SearchEngine ]
echo --------------------------
echo [ 1. Google ]
echo [ 2. Yahoo ]
echo [ 3. MSN ]
set /p i=Choose SearchEngine:
if not defined i goto start
if "%i%"=="1" goto google
if "%i%"=="2" goto yahoo
if "%i%"=="3" goto msn
goto start
set /p g=Google Search:
if not defined g goto start
set g=%g: =+%
set g=%g:+/= %
call :gsearch %g%
goto start
:gsearch
if /i "%2"=="" start http://www.google.com/search?q=%1
if /i "%2"=="w" start http://www.google.com/search?q=%1
if /i "%2"=="i" start http://images.google.com/images?q=%1
if /i "%2"=="v" start http://video.google.com/videosearch?q=%1
goto :eof
:yahoo
set /p y=Yahoo Search:
if not defined y goto start
set y=%y: =+%
set y=%y:+/= %
call :ysearch %g%
goto start
:ysearch
if /i "%2"=="" start http://search.yahoo.com/search?p=%1
if /i "%2"=="w" start http://search.yahoo.com/search?p=%1
if /i "%2"=="i" start http://images.search.yahoo.com/search/images?p=%1
if /i "%2"=="v" start http://video.search.yahoo.com/search/video?p=%1
goto :eof
:msn
set /p m=MSN Search:
if not defined m goto start
set m=%m: =+%
set m=%m:+/= %
call :msearch %g%
goto start
:msearch
if /i "%2"=="" start http://search.msn.com/results.aspx?q=%1
if /i "%2"=="w" start http://search.msn.com/results.aspx?q=%1
if /i "%2"=="i" start http://search.msn.com/images/results.aspx?q=%1
if /i "%2"=="v" start http://search.msn.com/results.aspx?q=%1+mpeg
goto :eof
-------------------------------------end of script------------------------------------
Copy paste script diatas ,truz save dgn extensi *.bat
Masih bingung cara makenya? Jelas aja kan belum dijelasain… Gimana seeh…hehe..
Berikut penjelasannya:
1. Tampilan awal:
Wow..keren juga....:p
Pada tahap ini untuk memilih search engine:
Tekan:
- 1 untuk paman gugel
- 2 untuk om yahoo
- 3 untuk m'pok em-es-en
- Truz tekan enter..
- 2 untuk om yahoo
- 3 untuk m'pok em-es-en
- Truz tekan enter..
Lalu, jreng tiba2muncul penampakan pesan seperti gambar dibawah (no. 2)…
2. Masukkan Keyword/Syntax
Di tahap ke-2 ini tinggal ketik aja kata2 yang sering kamu cari di Google.
- Syntax: Keyword [parameter]
- Parameter:
- /w = untuk mencari web
- /i = untuk mencari images/gambar
- /v =untuk mencari video/film
- /i = untuk mencari images/gambar
- /v =untuk mencari video/film
Misalnya: ingin mencari artis selingkuh, ketik aja:
- web = artis selingkuh /w
- gambar = artis selingkuh /i
- video = artis selingkuh /v
- web = artis selingkuh /w
- gambar = artis selingkuh /i
- video = artis selingkuh /v
Sudah jelas kan, kalau sudah kita sudahi saja acara ini, mohon maaf atas segala kekurangan.. Kalo ada lebihnya mohon dikembalikan yaa.. hehe..
Good luck!! ^_^