【问题标题】:Batch, Can I open a url from a batch script?批处理,我可以从批处理脚本中打开一个网址吗?
【发布时间】:2015-07-20 11:19:28
【问题描述】:
我会告诉你我有什么然后尝试解释这个问题,
@echo off
Echo put search in front of a question to search for the answer on the internet
Set /p question=
到目前为止,如果用户将搜索 I 放在搜索 Internet 的问题前面,我希望它也包含在一个批处理文件中。谢谢
【问题讨论】:
标签:
file
batch-file
search
【解决方案2】:
如果你只是想打开默认的网络浏览器,就像使用start一样简单。
此 sn-p 将通过替换“search:”并与原始变量进行比较来检查您的问题变量是否包含“search:”。如果它们匹配,则未输入搜索。
@setlocal enableextensions enabledelayedexpansion
set /p question=
set questionWOspaces=%question: =+%
IF NOT "%question:search:=%"=="%question%" (START http://www.google.com/search?q="%questionWOspaces:search:=%")