web browser interaction


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.
 
Ad

Advertisements

P

Pegasus [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Interactive input 2
Schedule Interacting with Desktop 0
MASTER BROWSER ISSUE 0

Top