Launch files and load URLs from the command line
Here’s a couple of tips I discovered while writing a script to analyze my web logs and then load the .html file with the analysis in a browser*:
Problem #1 - Have a script load an .html file in your browser (under MS Windows)
Solution - Run the command: start fileName.html
Problem #2 - The start command does not work under Cygwin
Solution - Invoke start this way: cmd /c start fileName.html
(I’m guessing this problem occurs because start is a built-in of the cmd.exe shell, so it can’t be invoked directly (i.e. there’s no start.exe))
Problem #3 - Display a URL in a browser from the command line
Solution - Run the command: start http://www.someURL.com/
(This appears to be an undocumented feature of the start command in Windows. Using other URI’s like file:// works too.)
*The method described here invokes whichever browser you have set as the default in Windows. Alternatively, you can invoke a specific browser using:
"C:\Program Files\Internet Explorer\IEXPLORE.EXE" www.site.com"C:\Program Files\Internet\Mozilla FireFox\firefox.exe" www.site.com
No Comments
No comments yet.
RSS feed for comments on this post.
Sorry, the comment form is closed at this time.



