如何在批处理文件中(或从
Windows 命令行) ,以便使用 start
命令来
在网址中打开带有与号的网页?
双引号在 start
中不起作用; 这将启动一个新的
命令行窗口。
更新1 : Wael Dalloul 的解决方案工作正常 有 URL 编码的字符(例如空格编码为 % 20) ,则“%”必须是 编码为“%%”。示例中的情况并非如此。
例如,从命令行(CMD.EXE
) :
start http://www.google.com/search?client=opera&rls=en&q=escape+ampersand&sourceid=opera&ie=utf-8&oe=utf-8
会导致
http://www.google.com/search?client=opera
在默认浏览器中打开,命令行窗口中出现以下错误:
'rls' is not recognized as an internal or external command,
operable program or batch file.
'q' is not recognized as an internal or external command,
operable program or batch file.
'sourceid' is not recognized as an internal or external command,
operable program or batch file.
'ie' is not recognized as an internal or external command,
operable program or batch file.
'oe' is not recognized as an internal or external command,
operable program or batch file.
平台: WindowsXP64位 SP2。