Hi there,
I'm a total newb at this. I'm trying to write a vbscript to download a file with random URL from a website. So far I have this vbs:
_________
URL="
http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/Definitions/"
Set WshShell = WScript.CreateObject("WScript.Shell")
Set http = CreateObject("Microsoft.XmlHttp")
On Error Resume Next
http.open "GET", URL, False
http.send ""
if err.Number = 0 Then
WScript.Echo http.responseText
Else
Wscript.Echo "error " & Err.Number & ": " & Err.Description
End If
set WshShell = Nothing
Set http = Nothing
_________
This downloads the HTML source code and outputs to the screen. I can output this to text file by using csript if I want, but it returns the entire page source code. I am only interested in the very first instance of a href='http://..........CBR.sgn'>.
The goal is to be able to download definition updates from a random URL based on the source code of that page. So once I can extract that to text I'll be set.
Any help parsing xmlhttp.responsetext to only return the first instance of the .CBR.sgn definition file would be excellent! Thank you.