# opening and downloading a text file using WSH



## nczman (Dec 12, 2000)

I am using windows scripting to open internet explorer, to go to a web site, enter some information into some text boxes to download a comma delimited text file. The only problem that I have is that there is an radio option that I need to select. The default is set to open an html page and the other option opens a second page that I can get to the place I need to download the file.

Everything would work, except for the radio option... Generally, I have been tabbing to new fields, but I can not get to this second radio to select it. Any suggestions on how I can do this???

Thanks in advance.


----------



## Arky (Aug 17, 2004)

I am assuming you mean radio buttons on a custom web browser using scripting. If so, then see the the book *Windows Scripting Secrets by Tobias Weltner*, pp 555-558. The book may be out of print, but is still the best on the subject if you can get it. If you cannot locate a copy, let me know and I will forward the pertinent pages.


----------



## nczman (Dec 12, 2000)

Thanks Arky. I went to Amazon and was able to see the Table of Contents. I am not sure that section has to do with what I want. I am not creating a web page. I am going out to a web site that we have access to. We log on, select some dates, then change the radio, from "show in html" to "get Comma delimited file".

If you dont mind, I would like to see the experts from the book. If it is not all about how to build web pages, I might just have to add that to my library.

Thanks

I have written the windows scripting to run on my computer at certain times of the day. It opens internet explorer, puts in the web address of our vender, tabs down to put in all of the necessary information, with the exception of that one radio option.

I have put some of the code below to give you an idea of what I have..


```
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run("C:\Progra~1\Intern~1\IEXPLORE.EXE http://techsite.com/clientadmin/login.aspx")

'ReturnCode = WshShell.Run("C:\Progra~1\Intern~1\IEXPLORE.EXE", 1, True)

WScript.Sleep 5000 'pause for 5 second
WshShell.SendKeys "{tab}"
WshShell.SendKeys "{tab}"
WshShell.SendKeys "{tab}"
WshShell.SendKeys "Login"
WshShell.SendKeys "{tab}"
WshShell.SendKeys "password"
WshShell.SendKeys "{tab}"
WshShell.SendKeys "{Enter}"
''''''''''''''''''''''''''''''''''''''''''''login
WScript.Sleep 5000 'pause for 5 second
WshShell.SendKeys "{tab}"
WshShell.SendKeys "{tab}"
'''''''here is the 1st radio option...
''''' how do I select the 2nd of the two...


thanks
```


----------



## Shadow2531 (Apr 30, 2001)

You can tab over to the first radio option, but to move to the next radio option, you would need to use one of the arrow keys like right or down.


----------



## Arky (Aug 17, 2004)

The attachment includes the pages I mentioned. If you need others, let me know. This the first time I have sent an attachment on the site. If you can't find it, I'll e-mail it to direct.


----------



## nczman (Dec 12, 2000)

Arky - thanks for taking the time to post that for me.. That kind of shows that the book was not quite what I was looking for. 

Shadow - Thanks for the response


Sendkey Down was exactly what I was looking for... WORKS... It is always the easy things that get me...I must have been sleeping when they had that class....

THANKS again guys.... This board is the greatest


----------

