web browser interaction

  • Thread starter Thread starter JoJo
  • Start date Start date
J

JoJo

Folks:

I know I can use the START command to go to a particular website, say,
START http://www.MyWebSite.com/1
If the page is blank or unavailable then that page will start with "The page
cannot be found".

* If possible how can I print the message "The page cannot be found" to
screen when the web page has this message ?
* Is there some switch that can be used with the START command to launch
a new web browser or use any old browser window already open ?


Thanks,
Jon.
 
JoJo said:
Folks:

I know I can use the START command to go to a particular website, say,
START http://www.MyWebSite.com/1
If the page is blank or unavailable then that page will start with "The
page
cannot be found".

* If possible how can I print the message "The page cannot be found" to
screen when the web page has this message ?
* Is there some switch that can be used with the START command to
launch
a new web browser or use any old browser window already open ?


Thanks,
Jon.

The correct command to start your browser with IE is
"c:\Program Files\Internet Explorer\iexplore.exe" http://...

Using the Start command is unnecessary and may not give you the expected
result.

To see whether a certain web page is available you could use wget.exe and
check its output for the word "Error":
@echo off
c:\tools\wget.exe www.google.com/BadPage 1>nul 2>"%temp%\wget.txt"
type "%temp%"\wget.txt | find /i "Error" && echo Page not found!
(untested batch file)

To put the focus on a pre-existing window you could use nircmd.exe:
c:\tools\nircmd win activate title "geotool - mozilla firefox"

You can get wget.exe from http://www.interlog.com/~tcharron/wgetwin.html and
nircmd.exe from http://www.nirsoft.net/utils/nircmd.html.
 
Back
Top