Batch automated text entry.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
ibiza2008
Posts: 2
Joined: 18 Feb 2009 12:26

Batch automated text entry.

#1 Post by ibiza2008 » 18 Feb 2009 12:33

I want to create a batch file that automatically opens an internet browser and, when the home page is loaded (google), it will enter a predetermined string of text into the search bar, hit 'tab' and then 'enter' to execute the search. I have finished the part of the code that opens internet explorer but cannot figure out how to enter text into search bar. Is this possible and if so how? If it isn't is there a different type of code to execute these commands? Thanks.

jaffamuffin
Posts: 40
Joined: 25 Jan 2008 14:05

#2 Post by jaffamuffin » 18 Feb 2009 17:13

open the web browser with this address :

http://www.google.com/search?q=test

and replace test with whatever you want to search for...

ibiza2008
Posts: 2
Joined: 18 Feb 2009 12:26

#3 Post by ibiza2008 » 18 Feb 2009 20:25

Thanks, that works!

However this is a second part to this program that I'm trying to write where the batch file needs to enter text into a text box like the one I'm writing into now. The text would be predetermined in the program. I know how the 'echo' command prints text to the DOS screen, is there a way to mimic the text written in DOS in a text box embedded in the browser? If so, is there also a way to press 'enter'?

Basically, the flow chart would be kind of like this:
1.) open page with text box
2.) navigate to the text box so that it can be written in ('tab')
3.) navigate to the "execute" or "submit" box and press enter to enter the text ('tab' and 'enter')

I hope there is a way.

Thanks for your help so far!

jaffamuffin
Posts: 40
Joined: 25 Jan 2008 14:05

#4 Post by jaffamuffin » 19 Feb 2009 04:01

not using batch.

You would need some kind of gui tool.

Unless you can pass the contents of the form as a parameter in the same way the search term is passed to google as a parameter.

There are tools to copy text to the clipboard in a batch file so you could get the text 'out' of the batch easily enough.

Post Reply