如何在 Windows 中使用命令行打开带有 GET 查询参数的 URL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6375149/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 17:04:40  来源:igfitidea点击:

How to open a URL with GET query parameters using the command line in Windows

windowscommand-line

提问by rogerdpack

Possible Duplicate:
How do I escape ampersands in batch files?

可能的重复:
如何在批处理文件中转义与号?

I am attempting the following, in Windows:

我正在尝试以下操作,在 Windows 中:

 $ start http://code.google.com/p/mulder/downloads/detail?name=MPUI.2011-06-09.Full-Package.exe&can=2&q=MPlayer&sort=-uploaded

Unfortunately, it seems that no amount of quoting or escaping actually pulls up the full URL in a browser, only partial (up through can=2) or what not. How can I do it?

不幸的是,似乎没有多少引用或转义实际上会在浏览器中拉出完整的 URL,只有部分(通过 can=2)或其他什么。我该怎么做?

采纳答案by Tom Hazel

You can use ^ to escape & in teh command line like this:

您可以像这样在命令行中使用 ^ 转义 & :

 $ start http://code.google.com/p/mulder/downloads/detail?name=MPUI.2011-06-09.Full-Package.exe^&can=26^&q=MPlayer^&sort=-uploaded

回答by shellter

Try this

尝试这个

start "test" "C:\Program Files (x86)\Internet Explorer\iexplore.exe" "http://code.google.com/p/mulder/downloads/detail?name=MPUI.2011-06-09.Full-Package.exe&can=2&q=MPlayer&sort=-uploaded"

It worked for me in Windows 7. (all on one line).

它在 Windows 7 中对我有用。(全部在一行上)。

I hope this helps.

我希望这有帮助。