windows 如何在 CYGWIN 会话中使用 URL 启动 IE
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1096066/
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
How to start IE with a URL in a CYGWIN session
提问by Chiwai Chan
I have a windows xp machine set up with Cygwin running the ssh service, on that machine I have a bat script that opens up IE using the following command "C:\Program Files\Internet Explorer\iexplore.exe" "http://windowsxpbox:3000/flex/flexUnitTests?debug=true#automated=true".
我有一台装有 Cygwin 并运行 ssh 服务的 Windows xp 机器,在那台机器上我有一个 bat 脚本,它使用以下命令打开 IE:“C:\Program Files\Internet Explorer\iexplore.exe”“ http:// windowsxpbox:3000/flex/flexUnitTests?debug=true#automated=true”。
The script runs fine when I'm calling it locally on that xp machine, I am trying to call that same bat script remotely from another machine and achieve the same result but with IE opened on the remote machine, my problem is when the bat script is called remotely nothing happens on the remote machine.
当我在该 xp 机器上本地调用该脚本时,该脚本运行良好,我试图从另一台机器远程调用相同的 bat 脚本并获得相同的结果,但是在远程机器上打开 IE,我的问题是当 bat 脚本远程调用远程机器上没有任何事情发生。
回答by andrewdotn
Just:
只是:
cygstart "http://www.google.com"
where google.com is your desired URL.
其中 google.com 是您想要的网址。
cygstart
launches the default windows program for a path. So this way you get the user's preferred web browser...
cygstart
启动路径的默认 Windows 程序。因此,通过这种方式,您可以获得用户首选的 Web 浏览器...
回答by guest
cygstart /cygdrive/c/Programme/Internet\ Explorer/iexplore.exe "www.google.at"
cygstart /cygdrive/c/Programme/Internet\ Explorer/iexplore.exe "www.google.at"
path may change according to your installation
路径可能会根据您的安装而改变
回答by Mark Ransom
Cygwin's shell doesn't know how to execute a batch script. Use cygwin to start cmd.exe, and let that run the batch file. E.G.
Cygwin 的 shell 不知道如何执行批处理脚本。使用 cygwin 启动 cmd.exe,让它运行批处理文件。例如
/cygdrive/c/Windows/System32/cmd.exe /c "c:\myscript.bat"
Edit: if you'd rather run explorer directly rather than relying on a batch file, the following works properly for me:
编辑:如果您宁愿直接运行资源管理器而不是依赖批处理文件,以下对我来说正常工作:
$ "/cygdrive/c/Program Files/Internet Explorer/iexplore.exe" "http://windowsxpbox:3000/flex/flexUnitTests?debug=true#automated=true"