DOS & Web

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

JoJo

Hello:


Whenever my system reboots, I am interested in going to a specific web page
and clicking on a button that is on that web page
So first, I put the appropriate icon in my startup folder.

* At this point, is it possible to use a DOS batch file or DOS command to
click on a button (title "REPLAY") on the web page ?
* Also I am looking for general information on how DOS can interact with
web (HTTP) pages ?


Thanks
 
JoJo said:
Hello:


Whenever my system reboots, I am interested in going to a specific web
page
and clicking on a button that is on that web page
So first, I put the appropriate icon in my startup folder.

* At this point, is it possible to use a DOS batch file or DOS command
to
click on a button (title "REPLAY") on the web page ?
* Also I am looking for general information on how DOS can interact with
web (HTTP) pages ?


Thanks

DOS was introduced in the late 70s, decades before the web saw the light of
the day. It knows nothing about the web. However, you can create a Windows
shortcut having the following command line:
"C:\Program Files\Internet Explorer\iexplore.exe" www.google.com
If you place this shortcut into your Startup folder then it will start
automatically at logon time.
 
Pegasus (MVP) wrote:
....
However, you can create a Windows
shortcut having the following command line:
"C:\Program Files\Internet Explorer\iexplore.exe" www.google.com
If you place this shortcut into your Startup folder then it will start
automatically at logon time.

To use the default browser from a batch:

start "" "http://www.google.com/"

For further automation you may need tools like AutoIt or iMacros
 
JoJo said:
Hello:


Whenever my system reboots, I am interested in going to a specific web
page
and clicking on a button that is on that web page
So first, I put the appropriate icon in my startup folder.

* At this point, is it possible to use a DOS batch file or DOS command
to
click on a button (title "REPLAY") on the web page ?

Not directly, and not by itself. Tools are available for this sort of thing
(google "AutoIT"), however getting a script to accurately click on the
desired control on a web page is like asking a blind person to do it. No, I
take that back - a blind person is way more likely to succeed than a dumb
script.

/Al
 
Not directly, and not by itself. Tools are available for this sort of thing
(google "AutoIT"), however getting a script to accurately click on the
desired control on a web page is like asking a blind person to do it. No,I
take that back - a blind person is way more likely to succeed than a dumb
script.

/Al

Rather than use AutoItX, I'd use IE.Applications to open the page in a
WSH script and then use DHTML code to to CLICK it. Its very easy if
the control has an ID/Name associated with it, but is still possible
with document.all.tags(sTagType), where sTagType indicates what kind
of an element it is, probably INPUT. Then short through the
collection to find the right one. This will take some experimenting,
checking for their TYPE attributes until a BUTTON is found or a SUBMIT
as appropriate and then finding the right one.

Here's a little example (untested) theat outlines part of the
search ...

sURL = "www.somewhere.com/somefolder/some.html"
set oIE = CreateObject("InternetExplorer.Application")
with oIE
.Navigate("http://" & sURL)
Do until .ReadyState = 4 : WScript.Sleep 100 : Loop
set cControls = .document.all.tags("input")
nControls = cControls.length
nIdx = 0
for each control in cControls
s = s & nIdx & ", " & control.type & vbNewLine
nIdx = nIdx + 1
next
wsh.echo "Number of Controls:", nControls, vbNewline, s
End With ' IE

Once the proper control is found it can be clicked with something
like ...

oIE.document.all.tags("input")(nIdx).click

At least, that's the way I'd try to do it.

Tom Lavedas
***********
http://there.is.no.more/tglbatch/
 
Back
Top