批处理之家's Archiver

HoeKey 发表于 2009-2-16 05:56

集成26个搜索串的批处理

里面有各大网站的搜索串
是用来外部调用的
管理员别封我号就行了[code]@echo off
set str=%*
if "%1"=="b" goto Baidu
if "%1"=="y" goto yahoo
if "%1"=="w" goto youdao
if "%1"=="s" goto sogou
if "%1"=="so" goto soso
if "%1"=="go" goto gougou
if "%1"=="ku" goto youku
if "%1"=="yi" goto yinyue
if "%1"=="d" goto duote
if "%1"=="di" goto dict
if "%1"=="p" goto chinarank
if "%1"=="yh" goto yyh
if "%1"=="hy" goto hyy
if "%1"=="f" goto kuaiche
if "%1"=="h" goto huajun
if "%1"=="t" goto tiankong
if "%1"=="tb" goto tieba
if "%1"=="zd" goto zhidao
if "%1"=="p3" goto mp3
if "%1"=="tp" goto tupian
if "%1"=="sp" goto shipin
if "%1"=="bk" goto baike
if "%1"=="kj" goto kongjian
if "%1"=="zl" goto ziliao
if "%1"=="xw" goto xinwen
start "" "http://www.google.com/search?hl=zh-CN&ie=GB2312&q=%str:*g =%"
exit /b

:Baidu
start "" "http://www.baidu.com/s?wd=%str:*b =%"
exit /b

:yahoo
start "" "http://one.cn.yahoo.com/s?p=%str:*y =%&pid=hp&v=web"
exit /b

:youdao
start "" "http://www.youdao.com/search?q=%str:*w =%&ue=gbk&keyfrom=163index"
exit /b

:sogou
start "" "http://www.sogou.com/web?query=%str:*s =%"
exit /b

:soso
start "" "http://www.soso.com/q?pid=s.idx&w=%str:*so =%"
exit /b

:gougou
start "" "http://search.gougou.com/search?search=%str:*go =%"
exit /b

:youku
start "" "http://so.youku.com/search_video/q_%str:*ku =%"
exit /b

:yinyue
start "" "http://d.sogou.com/music.so?pf=&query=%str:*yi =%"
exit /b

:duote
start "" "http://www.duote.com/search.php?searchType=&so=%str:*d =%"
exit /b
:dict
start "" "http://www.dict.cn/search?q=%str:*di =%"
exit /b

:chinarank
start "" "http://www.chinarank.org.cn/overview/Info.do?url=%str:*p =%"
exit /b

:yyh
start "" "http://translate.google.cn/translate_t?hl=zh-CN#en|zh-CN|%str:*yh =%"
exit /b

:hyy
start "" "http://translate.google.cn/translate_t#zh-CN|en|%str:*hy =%"
exit /b

:kuaiche
start "" "http://s.kuaiche.com/s/btsearch?q=%str:*f =%&tid=1&type=%E7%94%B5%E5%BD%B1"
exit /b

:huajun
start "" "http://search.newhua.com/search.asp?Keyword=%str:*h =%"
exit /b

:tiankong
start "" "http://www.skycn.com/search.php?ss_name=%str:*t =%&sor=00&sf=default"
exit /b

:tieba
start "" "http://tieba.baidu.com/f?ct=&tn=&rn=&pn=&lm=&kw=%str:*tb =%"
exit /b

:zhidao
start "" "http://zhidao.baidu.com/q?word=%str:*zd =%&ct=17&lm=0&pn=0&tn=ikaslist&rn=10&fr=idx_1"
exit /b

:mp3
start "" "http://mp3.baidu.com/m?f=ms&rn=&tn=baidump3&ct=134217728&word=%str:*p3 =%&lm=-1"
exit /b

:tupian
start "" "http://image.baidu.com/i?ct=201326592&cl=2&lm=-1&tn=baiduimage&pv=&word=%str:*tp =%&z=0"
exit /b

:shipin
start "" "http://video.baidu.com/v?ct=301989888&rn=20&pn=0&db=0&s=0&fbl=1024&word=%str:*sp =%"
exit /b

:baike
start "" "http://baike.baidu.com/list-php/dispose/not_exists.php?word=%str:*bk =%"
exit /b

:kongjian
start "" "http://hi.baidu.com/%str:*kj =%"
exit /b

:ziliao
start "" "http://passport.baidu.com/?business&aid=7&default_tab=2&un=%str:*zl =%"
exit /b

:xinwen
start "" http://news.baidu.com/ns?word=%str:*xw =%&tn=news&from=news&cl=2&rn=20&ct=1[/code]g=谷歌
b=百度
y=雅虎
w=有道
s=搜狗
so=搜搜
go=狗狗
ku=优酷
yi=搜狗音乐
d=多特
di=dice海词
p=中国网站排名
yh=谷歌翻译(英译汉)
hy=谷歌翻译(汉译英)
f=快车搜索
h=华军
t=天空
tb=百度贴吧
zd=百度知道
p3=百度mp3
tp=百度图片
sp=百度视频
bk=百度百科
kj=百度空间
zl=百度用户资料
xw=百度新闻

tireless 发表于 2009-2-16 14:28

那些 if 可用一个 for 代替:[code]@echo off
set str=%*
for %%a in (b y w s so go ku yi d di p yh hy f h t tb zd p3 tp sp bk kj zl xw) do (
  if "%1"=="%%a" goto %%a
)
start "" "http://www.google.com/search?hl=zh-CN&ie=GB2312&q=%str:*g =%"
exit /b

:b 百度
start "" "http://www.baidu.com/s?wd=%str:*b =%"
exit /b

:y 雅虎
start "" "http://one.cn.yahoo.com/s?p=%str:*y =%&pid=hp&v=web"
exit /b

:w 有道
start "" "http://www.youdao.com/search?q=%str:*w =%&ue=gbk&keyfrom=163index"
exit /b

:s 搜狗
start "" "http://www.sogou.com/web?query=%str:*s =%"
exit /b

:so 搜搜
start "" "http://www.soso.com/q?pid=s.idx&w=%str:*so =%"
exit /b

:go 狗狗
start "" "http://search.gougou.com/search?search=%str:*go =%"
exit /b

:ku 优酷
start "" "http://so.youku.com/search_video/q_%str:*ku =%"
exit /b

:yi 搜狗音乐
start "" "http://d.sogou.com/music.so?pf=&query=%str:*yi =%"
exit /b

:d 多特
start "" "http://www.duote.com/search.php?searchType=&so=%str:*d =%"
exit /b

:di dice海词
start "" "http://www.dict.cn/search?q=%str:*di =%"
exit /b

:p 中国网站排名
start "" "http://www.chinarank.org.cn/overview/Info.do?url=%str:*p =%"
exit /b

:yh 谷歌翻译(英译汉)
start "" "http://translate.google.cn/translate_t?hl=zh-CN#en|zh-CN|%str:*yh =%"
exit /b

:hy 谷歌翻译(汉译英)
start "" "http://translate.google.cn/translate_t#zh-CN|en|%str:*hy =%"
exit /b

:f 快车搜索
start "" "http://s.kuaiche.com/s/btsearch?q=%str:*f =%&tid=1&type=%E7%94%B5%E5%BD%B1"
exit /b

:h 华军
start "" "http://search.newhua.com/search.asp?Keyword=%str:*h =%"
exit /b

:t 天空
start "" "http://www.skycn.com/search.php?ss_name=%str:*t =%&sor=00&sf=default"
exit /b

:tb 百度贴吧
start "" "http://tieba.baidu.com/f?ct=&tn=&rn=&pn=&lm=&kw=%str:*tb =%"
exit /b

:zd 百度知道
start "" "http://zhidao.baidu.com/q?word=%str:*zd =%&ct=17&lm=0&pn=0&tn=ikaslist&rn=10&fr=idx_1"
exit /b

:p3 百度mp3
start "" "http://mp3.baidu.com/m?f=ms&rn=&tn=baidump3&ct=134217728&word=%str:*p3 =%&lm=-1"
exit /b

:tp 百度图片
start "" "http://image.baidu.com/i?ct=201326592&cl=2&lm=-1&tn=baiduimage&pv=&word=%str:*tp =%&z=0"
exit /b

:sp 百度视频
start "" "http://video.baidu.com/v?ct=301989888&rn=20&pn=0&db=0&s=0&fbl=1024&word=%str:*sp =%"
exit /b

:bk 百度百科
start "" "http://baike.baidu.com/list-php/dispose/not_exists.php?word=%str:*bk =%"
exit /b

:kj 百度空间
start "" "http://hi.baidu.com/%str:*kj =%"
exit /b

:zl 百度用户资料
start "" "http://passport.baidu.com/?business&aid=7&default_tab=2&un=%str:*zl =%"
exit /b

:xw 百度新闻
start "" "http://news.baidu.com/ns?word=%str:*xw =%&tn=news&from=news&cl=2&rn=20&ct=1"[/code]

HoeKey 发表于 2009-2-16 14:41

呵呵  还是你厉害啊

随风 发表于 2009-2-16 21:19

何必要for呢 直接
@echo off
set str=%*
goto %~1
不行吗?

tireless 发表于 2009-2-16 21:29

回复 4楼 的帖子

行,如果不考虑 不输入搜索引擎别名 的情况下。那个代码考虑了 不输入搜索引擎别名 时,默认进行Google搜索。

conglin58 发表于 2022-8-16 16:30

N久没来了!没想到论坛还在!不容易!

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.