如何使用批处理脚本和关键字搜索Internet? [英] How do you search the Internet with a batch script and a keyword?

查看:94
本文介绍了如何使用批处理脚本和关键字搜索Internet?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个批处理文件,一旦您键入内容并单击Enter,便会转到Internet上的搜索页面.关键是,您要搜索的内容之前先输入一个关键字.假设我想搜索鲸鱼的质量或某些东西,在程序中键入搜索鲸鱼的质量是什么",以告诉我是否要上网,脚本是否读取以查看是否单词搜索是问题的重中之重.如果是,它将搜索Internet,如果不是,我的程序将显示重新键入命令"或类似内容.任何帮助都将非常感谢

I would like to create a batch file that once you type something in and click enter you go to an search page on the Internet. The thing is, you type in a keyword before what you want to search. So say I wanted to search the mass of a whale or something, into my program I would type "search what is the mass of a whale" so to tell if I want to go on the Internet or not the script reads to see if the word search is in front of the question. If it is, it searches the Internet, if it isn't my program displays "Retype the command" or something. Any help would be great thanks

推荐答案

您可以使用单线执行此操作.将此另存为search.bat:

You can do this with a one-liner. Save this as search.bat:

@start "" "http://www.google.com/search?q=%*"

然后在控制台窗口中,运行命令:

Then in a console window, run the command:

search What is the airspeed velocity of an unladen swallow?

这篇关于如何使用批处理脚本和关键字搜索Internet?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆