[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
那些 if 可用一个 for 代替:
  1. @echo off
  2. set str=%*
  3. 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 (
  4.   if "%1"=="%%a" goto %%a
  5. )
  6. start "" "http://www.google.com/search?hl=zh-CN&ie=GB2312&q=%str:*g =%"
  7. exit /b
  8. :b 百度
  9. start "" "http://www.baidu.com/s?wd=%str:*b =%"
  10. exit /b
  11. :y 雅虎
  12. start "" "http://one.cn.yahoo.com/s?p=%str:*y =%&pid=hp&v=web"
  13. exit /b
  14. :w 有道
  15. start "" "http://www.youdao.com/search?q=%str:*w =%&ue=gbk&keyfrom=163index"
  16. exit /b
  17. :s 搜狗
  18. start "" "http://www.sogou.com/web?query=%str:*s =%"
  19. exit /b
  20. :so 搜搜
  21. start "" "http://www.soso.com/q?pid=s.idx&w=%str:*so =%"
  22. exit /b
  23. :go 狗狗
  24. start "" "http://search.gougou.com/search?search=%str:*go =%"
  25. exit /b
  26. :ku 优酷
  27. start "" "http://so.youku.com/search_video/q_%str:*ku =%"
  28. exit /b
  29. :yi 搜狗音乐
  30. start "" "http://d.sogou.com/music.so?pf=&query=%str:*yi =%"
  31. exit /b
  32. :d 多特
  33. start "" "http://www.duote.com/search.php?searchType=&so=%str:*d =%"
  34. exit /b
  35. :di dice海词
  36. start "" "http://www.dict.cn/search?q=%str:*di =%"
  37. exit /b
  38. :p 中国网站排名
  39. start "" "http://www.chinarank.org.cn/overview/Info.do?url=%str:*p =%"
  40. exit /b
  41. :yh 谷歌翻译(英译汉)
  42. start "" "http://translate.google.cn/translate_t?hl=zh-CN#en|zh-CN|%str:*yh =%"
  43. exit /b
  44. :hy 谷歌翻译(汉译英)
  45. start "" "http://translate.google.cn/translate_t#zh-CN|en|%str:*hy =%"
  46. exit /b
  47. :f 快车搜索
  48. start "" "http://s.kuaiche.com/s/btsearch?q=%str:*f =%&tid=1&type=%E7%94%B5%E5%BD%B1"
  49. exit /b
  50. :h 华军
  51. start "" "http://search.newhua.com/search.asp?Keyword=%str:*h =%"
  52. exit /b
  53. :t 天空
  54. start "" "http://www.skycn.com/search.php?ss_name=%str:*t =%&sor=00&sf=default"
  55. exit /b
  56. :tb 百度贴吧
  57. start "" "http://tieba.baidu.com/f?ct=&tn=&rn=&pn=&lm=&kw=%str:*tb =%"
  58. exit /b
  59. :zd 百度知道
  60. start "" "http://zhidao.baidu.com/q?word=%str:*zd =%&ct=17&lm=0&pn=0&tn=ikaslist&rn=10&fr=idx_1"
  61. exit /b
  62. :p3 百度mp3
  63. start "" "http://mp3.baidu.com/m?f=ms&rn=&tn=baidump3&ct=134217728&word=%str:*p3 =%&lm=-1"
  64. exit /b
  65. :tp 百度图片
  66. start "" "http://image.baidu.com/i?ct=201326592&cl=2&lm=-1&tn=baiduimage&pv=&word=%str:*tp =%&z=0"
  67. exit /b
  68. :sp 百度视频
  69. start "" "http://video.baidu.com/v?ct=301989888&rn=20&pn=0&db=0&s=0&fbl=1024&word=%str:*sp =%"
  70. exit /b
  71. :bk 百度百科
  72. start "" "http://baike.baidu.com/list-php/dispose/not_exists.php?word=%str:*bk =%"
  73. exit /b
  74. :kj 百度空间
  75. start "" "http://hi.baidu.com/%str:*kj =%"
  76. exit /b
  77. :zl 百度用户资料
  78. start "" "http://passport.baidu.com/?business&aid=7&default_tab=2&un=%str:*zl =%"
  79. exit /b
  80. :xw 百度新闻
  81. start "" "http://news.baidu.com/ns?word=%str:*xw =%&tn=news&from=news&cl=2&rn=20&ct=1"
复制代码

TOP

回复 4楼 的帖子

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

TOP

返回列表